CAN YOU GIVR SOLUTION OF MATH
FIND THE ANSWER OF THIS QUESTION MAKE A QUESTION BANK OF THIS MEANS RELEVENT QUESTION WHICH CAN COME IN MATH EXAM .IMP CHAPTER AREImportant chapters for exams Matrices and Determinants Trigonometry Differential Calculus Integral Calculus Differential Equations Laplace Transform Analytical geometry MAKE A SHORT QUESTION BANK WHICH CAN BE DONE IN A DAY SOLVE IT ALSO
A = [1 2 3]
[4 5 6]
| Type | Description | Example |
|---|---|---|
| Row Matrix | Only 1 row | [1, 2, 3] |
| Column Matrix | Only 1 column | [1; 2; 3] |
| Square Matrix | Rows = Columns | 2Γ2, 3Γ3 |
| Zero Matrix | All elements = 0 | [0,0;0,0] |
| Identity Matrix (I) | Diagonal = 1, rest = 0 | [1,0;0,1] |
| Diagonal Matrix | Non-diagonal = 0 | [2,0;0,5] |
| Symmetric Matrix | A = A^T | - |
| Skew-Symmetric | A = -A^T | - |
If A = [1 2 3] Then A^T = [1 4]
[4 5 6] [2 5]
[3 6]
[1 2] + [5 6] = [6 8]
[3 4] [7 8] [10 12]
2 Γ [1 2] = [2 4]
[3 4] [6 8]
[1 2] Γ [5 6] = [(1Γ5+2Γ7) (1Γ6+2Γ8)] = [19 22]
[3 4] [7 8] [(3Γ5+4Γ7) (3Γ6+4Γ8)] [43 50]
A = [1 1 1]
[1 2 -3]
[2 -1 3]
C = [ 3 -9 -5]
[-4 1 3]
[-5 4 1]
Adj(A) = [ 3 -4 -5]
[-9 1 4]
[-5 3 1]
Aβ»ΒΉ = (1/-11) Γ [ 3 -4 -5]
[-9 1 4]
[-5 3 1]
Aβ»ΒΉ = [-3/11 4/11 5/11]
[ 9/11 -1/11 -4/11]
[ 5/11 -3/11 -1/11]
A = [ 1 3 4]
[-1 6 0]
[ 3 4 2]
Adj(A) = [ 12 10 -24]
[ 2 -10 -4]
[-22 5 9]
D = |5 -7 1|
|6 -8 -1|
|3 2 -6|
Dx = |11 -7 1|
|15 -8 -1|
| 7 2 -6|
Dy = |5 11 1|
|6 15 -1|
|3 7 -6|
Dz = |5 -7 11|
|6 -8 15|
|3 2 7|
A = [1 1 1] X = [x] B = [3]
[2 -1 1] [y] [2]
[1 -2 3] [z] [2]
|3 1 1|
|2 -1 1| = 3(-3+2)-1(6-2)+1(-4+2) = 3(-1)-1(4)+1(-2) = -3-4-2 = -9
|2 -2 3|
|1 3 1|
|2 2 1| = 1(6-2)-3(6-1)+1(-4-2) = 4-15-6 = -17
|1 2 3|
|1 1 3|
|2 -1 2| = 1(-2+4)-1(4-2)+3(-4+1) = 2-2-9 = -9
|1 -2 2|
| Quadrant | x | y | Example |
|---|---|---|---|
| I (First) | + | + | (3, 5) |
| II (Second) | - | + | (-2, 4) |
| III (Third) | - | - | (-1, -3) |
| IV (Fourth) | + | - | (4, -2) |
Y
8| *(7,7)
7|
6|
5| *(0,5)
4|
3|
2|
1|
--+--+--+--+--+--+--+-- X
-3 -2 -1 0 1 2 3 4 5 6 7
*(5,0)
-1|
-2| *(-2,-2)
| Equation | Order | Degree |
|---|---|---|
| dy/dx = 5x + 3 | 1 | 1 |
| (dΒ²y/dxΒ²)Β³ + dy/dx = 0 | 2 | 3 |
| dΒ³y/dxΒ³ + 2(dy/dx)Β² = x | 3 | 1 |
| f(t) | L{f(t)} = F(s) |
|---|---|
| 1 | 1/s |
| t | 1/sΒ² |
| tβΏ | n!/s^(n+1) |
| e^(at) | 1/(s-a) |
| sin(at) | a/(sΒ²+aΒ²) |
| cos(at) | s/(sΒ²+aΒ²) |
| e^(at)sin(bt) | b/[(s-a)Β²+bΒ²] |
| e^(at)cos(bt) | (s-a)/[(s-a)Β²+bΒ²] |
| Chapter | Key Topics to Remember |
|---|---|
| Matrices | Order, Types, Adj, Aβ»ΒΉ, Cramer's Rule |
| Analytical Geometry | Distance formula, Area of triangle, Line equation, Quadrants |
| Trigonometry | Sum-to-product, tan(A-B) formula |
| Differential Calculus | Product rule, Chain rule, 2nd derivatives |
| Differential Equations | Order, Degree, Homogeneous, 2nd order linear |
| Integral Calculus | Standard integrals, Definite integrals |
| Laplace Transform | Definition, Standard formulas |
Study Tip: Focus on Q5-Q8 (Matrices), Q12-Q15 (Geometry), and Q23-Q24 (DEs) as they appear most frequently in your past papers. Good luck! π―
Generate a Word document with all solutions for easy printing
ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/math-question-bank
~/math-question-bank/generate.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
LevelFormat, PageNumber, Footer, Header, PageBreak
} = require('docx');
const fs = require('fs');
// Helper: heading paragraph
function h1(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [new TextRun({ text, bold: true, size: 32, font: "Arial" })],
spacing: { before: 320, after: 160 },
});
}
function h2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [new TextRun({ text, bold: true, size: 26, font: "Arial", color: "1F4E79" })],
spacing: { before: 240, after: 100 },
});
}
function h3(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, size: 24, font: "Arial", color: "2E75B6" })],
spacing: { before: 180, after: 80 },
});
}
function para(text, opts = {}) {
return new Paragraph({
children: [new TextRun({ text, font: "Arial", size: 22, ...opts })],
spacing: { before: 60, after: 60 },
});
}
function boldPara(label, value) {
return new Paragraph({
children: [
new TextRun({ text: label, bold: true, font: "Arial", size: 22 }),
new TextRun({ text: value, font: "Arial", size: 22 }),
],
spacing: { before: 60, after: 60 },
});
}
function answer(text) {
return new Paragraph({
children: [new TextRun({ text, font: "Courier New", size: 20, color: "1C5C1C" })],
spacing: { before: 40, after: 40 },
indent: { left: 400 },
});
}
function note(text) {
return new Paragraph({
children: [new TextRun({ text: " " + text, font: "Arial", size: 20, italics: true, color: "555555" })],
spacing: { before: 40, after: 40 },
indent: { left: 400 },
});
}
function blank() {
return new Paragraph({ children: [new TextRun("")], spacing: { before: 60, after: 60 } });
}
function divider() {
return new Paragraph({
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: "2E75B6", space: 4 } },
children: [new TextRun("")],
spacing: { before: 80, after: 80 },
});
}
function box(lines) {
// shaded paragraph box for formula
return lines.map(l => new Paragraph({
shading: { type: ShadingType.CLEAR, fill: "EFF3FB" },
children: [new TextRun({ text: l, font: "Courier New", size: 21, bold: true })],
spacing: { before: 20, after: 20 },
indent: { left: 360 },
}));
}
// Simple table helper
function simpleTable(headers, rows) {
const headerCells = headers.map(h => new TableCell({
shading: { type: ShadingType.CLEAR, fill: "1F4E79" },
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, color: "FFFFFF", font: "Arial", size: 20 })],
alignment: AlignmentType.CENTER,
})],
margins: { top: 60, bottom: 60, left: 100, right: 100 },
}));
const dataRows = rows.map((row, ri) => new TableRow({
children: row.map(cell => new TableCell({
shading: { type: ShadingType.CLEAR, fill: ri % 2 === 0 ? "FFFFFF" : "F0F4FF" },
children: [new Paragraph({
children: [new TextRun({ text: cell, font: "Arial", size: 20 })],
alignment: AlignmentType.LEFT,
})],
margins: { top: 40, bottom: 40, left: 100, right: 100 },
})),
}));
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({ children: headerCells, tableHeader: true }),
...dataRows,
],
});
}
// ---------------------------------------------------------------
// CONTENT
// ---------------------------------------------------------------
const children = [];
// TITLE PAGE
children.push(
new Paragraph({
children: [new TextRun({ text: "REMEDIAL MATHEMATICS", bold: true, size: 56, font: "Arial", color: "1F4E79" })],
alignment: AlignmentType.CENTER,
spacing: { before: 800, after: 200 },
}),
new Paragraph({
children: [new TextRun({ text: "QUESTION BANK WITH COMPLETE SOLUTIONS", bold: true, size: 32, font: "Arial", color: "2E75B6" })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 200 },
}),
new Paragraph({
children: [new TextRun({ text: "Course Code: DPH-106 | Program: Pharm. D | Year: 1st", size: 24, font: "Arial", color: "555555" })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 200 },
}),
new Paragraph({
children: [new TextRun({ text: "Atam Institute of Pharmacy | Om Sterling Global University", size: 22, font: "Arial", italics: true, color: "888888" })],
alignment: AlignmentType.CENTER,
spacing: { before: 0, after: 600 },
}),
divider(),
new Paragraph({
children: [new TextRun({ text: "Chapters Covered:", bold: true, size: 24, font: "Arial" })],
alignment: AlignmentType.CENTER,
spacing: { before: 300, after: 100 },
}),
simpleTable(
["#", "Chapter"],
[
["1", "Matrices and Determinants"],
["2", "Analytical Geometry"],
["3", "Trigonometry"],
["4", "Differential Calculus"],
["5", "Differential Equations"],
["6", "Integral Calculus"],
["7", "Laplace Transform"],
]
),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 1: MATRICES
// =============================
children.push(
h1("CHAPTER 1: MATRICES AND DETERMINANTS"),
divider(),
h2("Q1. Define Matrix and its Order"),
para("A Matrix is a rectangular arrangement of numbers (real or complex) arranged in rows and columns, enclosed in square brackets."),
blank(),
para("Order of a matrix = Number of Rows x Number of Columns", { bold: true }),
blank(),
para("Example:"),
...box([
"A = [ 1 2 3 ]",
" [ 4 5 6 ]",
"",
"Order = 2 x 3 (2 rows, 3 columns)",
]),
blank(),
h2("Q2. Types of Matrices"),
simpleTable(
["Type", "Description", "Example"],
[
["Row Matrix", "Only 1 row", "[1, 2, 3]"],
["Column Matrix", "Only 1 column", "[1; 2; 3]"],
["Square Matrix", "Rows = Columns", "2x2, 3x3"],
["Zero (Null) Matrix", "All elements = 0", "[0,0;0,0]"],
["Identity Matrix (I)", "Diagonal=1, rest=0", "[1,0;0,1]"],
["Diagonal Matrix", "Non-diagonal = 0", "[2,0;0,5]"],
["Symmetric Matrix", "A = A^T", "-"],
["Skew-Symmetric", "A = -A^T", "-"],
]
),
blank(),
h2("Q3. Transpose of a Matrix β Definition and Example"),
para("The Transpose of matrix A (written A^T) is obtained by interchanging its rows and columns."),
blank(),
...box([
"If A = [ 1 2 3 ] Then A^T = [ 1 4 ]",
" [ 4 5 6 ] [ 2 5 ]",
" [ 3 6 ]",
]),
blank(),
boldPara("Key Property: ", "(A^T)^T = A"),
blank(),
h2("Q4. Operations on Matrices β with Examples"),
h3("1. Addition (same order required)"),
...box([
"[ 1 2 ] + [ 5 6 ] = [ 6 8 ]",
"[ 3 4 ] [ 7 8 ] [ 10 12 ]",
]),
h3("2. Scalar Multiplication"),
...box([
"2 x [ 1 2 ] = [ 2 4 ]",
" [ 3 4 ] [ 6 8 ]",
]),
h3("3. Matrix Multiplication (A is mxn, B is nxp -> AB is mxp)"),
...box([
"[ 1 2 ] x [ 5 6 ] = [ 1x5+2x7 1x6+2x8 ] = [ 19 22 ]",
"[ 3 4 ] [ 7 8 ] [ 3x5+4x7 3x6+4x8 ] [ 43 50 ]",
]),
blank(),
h2("Q5. Find Adj(A) and A^(-1) for the matrix A = [1,1,1; 1,2,-3; 2,-1,3]"),
h3("Step 1 β Find det(A)"),
...box([
"det(A) = 1(2x3 - (-3)x(-1)) - 1(1x3 - (-3)x2) + 1(1x(-1) - 2x2)",
" = 1(6-3) - 1(3+6) + 1(-1-4)",
" = 3 - 9 - 5",
" = -11",
]),
h3("Step 2 β Cofactor Matrix"),
...box([
"C11=+3 C12=-9 C13=-5",
"C21=-4 C22=+1 C23=+3",
"C31=-5 C32=+4 C33=+1",
]),
h3("Step 3 β Adj(A) = Transpose of Cofactor Matrix"),
...box([
"Adj(A) = [ 3 -4 -5 ]",
" [ -9 1 4 ]",
" [ -5 3 1 ]",
]),
h3("Step 4 β A^(-1) = Adj(A) / det(A)"),
...box([
"A^(-1) = (1/-11) x Adj(A)",
"",
" = [ -3/11 4/11 5/11 ]",
" [ 9/11 -1/11 -4/11 ]",
" [ 5/11 -3/11 -1/11 ]",
]),
blank(),
h2("Q6. Find Adjoint of A = [1,3,4; -1,6,0; 3,4,2]"),
...box([
"det(A) = 1(12-0) - 3(-2-0) + 4(-4-18) = 12 + 6 - 88 = -70",
"",
"Cofactors:",
"C11=12 C12=2 C13=-22",
"C21=10 C22=-10 C23=5",
"C31=-24 C32=-4 C33=9",
"",
"Adj(A) = [ 12 10 -24 ]",
" [ 2 -10 -4 ]",
" [ -22 5 9 ]",
]),
blank(),
h2("Q7. Cramer's Rule: 5x-7y+z=11, 6x-8y-z=15, 3x+2y-6z=7"),
...box([
"D = 55",
"Dx = 55 => x = Dx/D = 55/55 = 1",
"Dy = -55 => y = Dy/D = -55/55 = -1",
"Dz = -55 => z = Dz/D = -55/55 = -1",
"",
"ANSWER: x = 1, y = -1, z = -1",
]),
blank(),
h2("Q8. Matrix Method: x+y+z=3, 2x-y+z=2, x-2y+3z=2"),
...box([
"A = [ 1 1 1 ] B = [ 3 ]",
" [ 2 -1 1 ] [ 2 ]",
" [ 1 -2 3 ] [ 2 ]",
"",
"det(A) = -9",
"",
"Dx = -9 => x = 1",
"Dy = -9 => y = 1",
"Dz = -9 => z = 1",
"",
"ANSWER: x = 1, y = 1, z = 1",
]),
blank(),
h2("Q9. Partial Fractions: (x-5) / [(x-3)(x-4)]"),
...box([
"Let (x-5)/[(x-3)(x-4)] = A/(x-3) + B/(x-4)",
"",
"=> x-5 = A(x-4) + B(x-3)",
"",
"Put x=3: -2 = A(-1) => A = 2",
"Put x=4: -1 = B(1) => B = -1",
"",
"ANSWER: 2/(x-3) - 1/(x-4)",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 2: ANALYTICAL GEOMETRY
// =============================
children.push(
h1("CHAPTER 2: ANALYTICAL GEOMETRY"),
divider(),
h2("Q10. Define Quadrant"),
para("The x-axis and y-axis divide the coordinate plane into four regions called Quadrants:"),
blank(),
simpleTable(
["Quadrant", "x-value", "y-value", "Example Point"],
[
["I (First)", "Positive (+)", "Positive (+)", "(3, 5)"],
["II (Second)", "Negative (-)", "Positive (+)", "(-2, 4)"],
["III (Third)", "Negative (-)", "Negative (-)", "(-1, -3)"],
["IV (Fourth)", "Positive (+)", "Negative (-)", "(4, -2)"],
]
),
blank(),
h2("Q11. Define Distance Formula"),
para("The distance between two points P(x1, y1) and Q(x2, y2) is:"),
blank(),
...box([
"d = sqrt[ (x2-x1)^2 + (y2-y1)^2 ]",
]),
para("This is derived from the Pythagorean theorem."),
blank(),
h2("Q12. Distance between (5, 4) and (-5, 6)"),
...box([
"d = sqrt[ (-5-5)^2 + (6-4)^2 ]",
" = sqrt[ (-10)^2 + (2)^2 ]",
" = sqrt[ 100 + 4 ]",
" = sqrt(104)",
" = 2*sqrt(26)",
" = 10.2 units (approx)",
]),
blank(),
h2("Q13. Show points (0,5), (-2,-2), (5,0), (7,7) on graph"),
para("Plot each point on the coordinate plane:"),
...box([
" Y-axis",
" 8 | * (7,7)",
" 5 | * (0,5)",
" 0 |--+--+--+--+--+--+-- X-axis",
" -2 5",
" -2 | *(-2,-2) *(5,0) is on X-axis",
]),
para("These four points form a quadrilateral shape when connected."),
blank(),
h2("Q14. Area of Triangle with vertices (0,0), (1,0), (1,1)"),
...box([
"Formula: Area = (1/2) |x1(y2-y3) + x2(y3-y1) + x3(y1-y2)|",
"",
"= (1/2) |0(0-1) + 1(1-0) + 1(0-0)|",
"= (1/2) |0 + 1 + 0|",
"= (1/2) x 1",
"",
"ANSWER: Area = 1/2 square unit",
]),
blank(),
h2("Q15. Equation of Line through (-4, -2) with slope = -8"),
...box([
"Point-Slope Form: y - y1 = m(x - x1)",
"",
"y - (-2) = -8(x - (-4))",
"y + 2 = -8x - 32",
"y = -8x - 34",
"",
"ANSWER: 8x + y + 34 = 0",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 3: TRIGONOMETRY
// =============================
children.push(
h1("CHAPTER 3: TRIGONOMETRY"),
divider(),
h2("Q16. Prove: cos52 + cos68 + cos172 = 0"),
...box([
"Using Sum-to-Product: cosA + cosB = 2cos[(A+B)/2]cos[(A-B)/2]",
"",
"cos68 + cos172",
"= 2 cos[(68+172)/2] cos[(172-68)/2]",
"= 2 cos(120) cos(52)",
"= 2 x (-1/2) x cos52",
"= -cos52",
"",
"So: cos52 + cos68 + cos172",
" = cos52 + (-cos52)",
" = 0 (PROVED)",
]),
blank(),
h2("Q17. If tan A = sqrt(3) and tan B = 2 - sqrt(3), find tan(A-B)"),
...box([
"Formula: tan(A-B) = (tanA - tanB) / (1 + tanA*tanB)",
"",
"tanA - tanB = sqrt(3) - (2-sqrt(3)) = 2*sqrt(3) - 2",
"",
"tanA * tanB = sqrt(3) * (2-sqrt(3)) = 2*sqrt(3) - 3",
"",
"1 + tanA*tanB = 1 + 2*sqrt(3) - 3 = 2*sqrt(3) - 2",
"",
"tan(A-B) = (2*sqrt(3)-2) / (2*sqrt(3)-2) = 1",
"",
"ANSWER: tan(A-B) = 1 => A-B = 45 degrees",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 4: DIFFERENTIAL CALCULUS
// =============================
children.push(
h1("CHAPTER 4: DIFFERENTIAL CALCULUS"),
divider(),
h2("Q18. Differentiate y = log(x) * tan(x)"),
...box([
"Product Rule: d/dx[u*v] = u*v' + v*u'",
"",
"u = log(x) => du/dx = 1/x",
"v = tan(x) => dv/dx = sec^2(x)",
"",
"dy/dx = log(x) * sec^2(x) + tan(x) * (1/x)",
"",
"ANSWER: dy/dx = log(x)*sec^2(x) + tan(x)/x",
]),
blank(),
h2("Q19. If y = x^8 - 12x^5 + 5x^3 - 12, find d2y/dx2"),
...box([
"First derivative:",
"dy/dx = 8x^7 - 60x^4 + 15x^2",
"",
"Second derivative:",
"d2y/dx2 = 56x^6 - 240x^3 + 30x",
"",
"ANSWER: d2y/dx2 = 56x^6 - 240x^3 + 30x",
]),
blank(),
h2("Q20. Find dy/dx for: (a) y = 3x^2 + 7x^7 (b) y = x^4 + sin(x)"),
...box([
"(a) y = 3x^2 + 7x^7",
" dy/dx = 6x + 49x^6",
"",
"(b) y = x^4 + sin(x)",
" dy/dx = 4x^3 + cos(x)",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 5: DIFFERENTIAL EQUATIONS
// =============================
children.push(
h1("CHAPTER 5: DIFFERENTIAL EQUATIONS"),
divider(),
h2("Q21. Note on Differential Equations"),
para("A Differential Equation is an equation that contains derivatives of a dependent variable with respect to one or more independent variables."),
blank(),
para("Types:", { bold: true }),
simpleTable(
["Type", "Description", "Example"],
[
["Ordinary DE (ODE)", "One independent variable", "dy/dx = 2x + 3"],
["Partial DE (PDE)", "Two or more independent variables", "du/dx + du/dy = 0"],
]
),
blank(),
h2("Q22. Order and Degree of a Differential Equation β 3 Examples"),
para("Order = order of the highest derivative present"),
para("Degree = power of the highest order derivative (after clearing fractions/radicals)"),
blank(),
simpleTable(
["Equation", "Order", "Degree"],
[
["dy/dx = 5x + 3", "1", "1"],
["(d2y/dx2)^3 + dy/dx = 0", "2", "3"],
["d3y/dx3 + 2(dy/dx)^2 = x", "3", "1"],
]
),
blank(),
h2("Q23. Solve: 2xy*dx + (x^2 + y^2)*dy = 0"),
...box([
"Rearrange: dx/dy = -(x^2 + y^2) / (2xy)",
"",
"Homogeneous. Substitute x = v*y => dx/dy = v + y*(dv/dy)",
"",
"v + y*(dv/dy) = -(v^2 + 1)/(2v)",
"",
"y*(dv/dy) = -(3v^2 + 1)/(2v)",
"",
"Separating variables:",
"2v*dv / (3v^2 + 1) = -dy/y",
"",
"Integrating:",
"(1/3)*ln(3v^2 + 1) = -ln(y) + C",
"",
"Substitute back v = x/y:",
"",
"GENERAL SOLUTION: 3x^2 + y^2 = k*y",
]),
blank(),
h2("Q24. Solve: 4*d2y/dx2 + 4*dy/dx - 3y = e^(2x)"),
...box([
"Auxiliary Equation: 4m^2 + 4m - 3 = 0",
"(2m+3)(2m-1) = 0",
"m = 1/2 or m = -3/2",
"",
"Complementary Function:",
"y_c = C1*e^(x/2) + C2*e^(-3x/2)",
"",
"Particular Integral (for e^(2x), replace D with 2):",
"P.I. = e^(2x) / [4(4) + 4(2) - 3]",
" = e^(2x) / [16 + 8 - 3]",
" = e^(2x) / 21",
"",
"GENERAL SOLUTION:",
"y = C1*e^(x/2) + C2*e^(-3x/2) + e^(2x)/21",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 6: INTEGRAL CALCULUS
// =============================
children.push(
h1("CHAPTER 6: INTEGRAL CALCULUS"),
divider(),
h2("Standard Integral Formulas"),
simpleTable(
["Function f(x)", "Integral (+ C)"],
[
["x^n", "x^(n+1) / (n+1)"],
["1/x", "ln|x|"],
["e^x", "e^x"],
["sin(x)", "-cos(x)"],
["cos(x)", "sin(x)"],
["sec^2(x)", "tan(x)"],
["a^x", "a^x / ln(a)"],
]
),
blank(),
h2("Q25. Evaluate: INT (3x^2 + 2x + 5) dx"),
...box([
"= 3*(x^3/3) + 2*(x^2/2) + 5x + C",
"= x^3 + x^2 + 5x + C",
"",
"ANSWER: x^3 + x^2 + 5x + C",
]),
blank(),
h2("Q26. Evaluate: INT sin(x) dx and INT cos(x) dx"),
...box([
"INT sin(x) dx = -cos(x) + C",
"INT cos(x) dx = sin(x) + C",
]),
blank(),
h2("Q27. Evaluate: INT e^x dx and INT (1/x) dx"),
...box([
"INT e^x dx = e^x + C",
"INT 1/x dx = ln|x| + C",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// =============================
// CHAPTER 7: LAPLACE TRANSFORM
// =============================
children.push(
h1("CHAPTER 7: LAPLACE TRANSFORM"),
divider(),
h2("Q28. Definition of Laplace Transform"),
para("The Laplace Transform of a function f(t) is defined as:"),
blank(),
...box([
"L{f(t)} = F(s) = INT(0 to inf) e^(-s*t) * f(t) dt",
"",
"where s is a complex number (s > 0 for convergence)",
]),
blank(),
h2("Q29. Standard Laplace Transform Table (Must Memorize)"),
simpleTable(
["f(t)", "L{f(t)} = F(s)"],
[
["1", "1/s"],
["t", "1/s^2"],
["t^n", "n! / s^(n+1)"],
["e^(at)", "1/(s-a)"],
["sin(at)", "a / (s^2 + a^2)"],
["cos(at)", "s / (s^2 + a^2)"],
["e^(at)*sin(bt)", "b / [(s-a)^2 + b^2]"],
["e^(at)*cos(bt)", "(s-a) / [(s-a)^2 + b^2]"],
]
),
blank(),
h2("Q30. Find L{3t^2 + 2*e^(3t) + sin(4t)}"),
...box([
"L{3t^2} = 3 * (2!/s^3) = 6/s^3",
"L{2*e^(3t)} = 2/(s-3)",
"L{sin(4t)} = 4/(s^2+16)",
"",
"ANSWER: F(s) = 6/s^3 + 2/(s-3) + 4/(s^2+16)",
]),
blank(),
new Paragraph({ children: [new PageBreak()] }),
);
// QUICK REVISION PAGE
children.push(
h1("QUICK REVISION SUMMARY"),
divider(),
simpleTable(
["Chapter", "Key Topics to Remember"],
[
["1. Matrices & Determinants", "Order, Types, Adj, A^(-1), Cramer's Rule, Matrix Method, Partial Fractions"],
["2. Analytical Geometry", "Distance formula, Area of triangle, Line equation, Quadrants, Plotting points"],
["3. Trigonometry", "Sum-to-product formula, tan(A-B) formula, cos identity proofs"],
["4. Differential Calculus", "Product rule, Chain rule, 1st and 2nd derivatives, log/trig differentiation"],
["5. Differential Equations", "Order & Degree, Homogeneous DE, 2nd order linear DE with constant coefficients"],
["6. Integral Calculus", "Standard integral table, Power rule, Trig integrals, e^x & ln integrals"],
["7. Laplace Transform", "Definition (integral form), Standard formula table, Linearity property"],
]
),
blank(),
blank(),
new Paragraph({
children: [new TextRun({ text: "Best of Luck for Your Exam! Study Smart, Not Just Hard.", bold: true, size: 26, font: "Arial", color: "1F4E79" })],
alignment: AlignmentType.CENTER,
spacing: { before: 300 },
}),
);
// ---------------------------------------------------------------
// BUILD DOCUMENT
// ---------------------------------------------------------------
const doc = new Document({
styles: {
default: {
document: { run: { font: "Arial", size: 22 } },
},
paragraphStyles: [
{
id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 34, bold: true, font: "Arial", color: "1F4E79" },
paragraph: { spacing: { before: 320, after: 160 }, outlineLevel: 0 },
},
{
id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 26, bold: true, font: "Arial", color: "2E75B6" },
paragraph: { spacing: { before: 200, after: 100 }, outlineLevel: 1 },
},
],
},
numbering: { config: [] },
sections: [{
properties: {
page: {
margin: { top: 1000, bottom: 1000, left: 1200, right: 1000 },
},
},
footers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun({ text: "Remedial Mathematics (DPH-106) | Question Bank with Solutions | Page ", font: "Arial", size: 18, color: "888888" }),
new TextRun({ children: [PageNumber.CURRENT], font: "Arial", size: 18, color: "888888" }),
],
alignment: AlignmentType.CENTER,
}),
],
}),
},
children,
}],
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/math-question-bank/Remedial_Math_Question_Bank.docx", buffer);
console.log("SUCCESS: File written.");
}).catch(err => {
console.error("ERROR:", err);
process.exit(1);
});
cd /home/daytona/workspace/math-question-bank && node generate.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/math-question-bank/Remedial_Math_Question_Bank.docx 2>&1
ls -lh /home/daytona/workspace/math-question-bank/Remedial_Math_Question_Bank.docx && python3 -c "import zipfile; z=zipfile.ZipFile('/home/daytona/workspace/math-question-bank/Remedial_Math_Question_Bank.docx'); print('Valid ZIP with files:', z.namelist()[:8])"
Remedial Math Question Bank
Word Document Β· DOCX
| Section | Content |
|---|---|
| Title Page | Course info, chapter list table |
| Chapter 1 - Matrices | Q1-Q9: Definitions, Types, Transpose, Operations, Adj & Aβ»ΒΉ, Cramer's Rule, Matrix Method, Partial Fractions |
| Chapter 2 - Analytical Geometry | Q10-Q15: Quadrants, Distance Formula, Area of Triangle, Line Equations, Graph plotting |
| Chapter 3 - Trigonometry | Q16-Q17: cos identity proof, tan(A-B) formula |
| Chapter 4 - Differential Calculus | Q18-Q20: Product rule, 2nd derivatives, dy/dx problems |
| Chapter 5 - Differential Equations | Q21-Q24: Definitions, Order & Degree, Homogeneous DE, 2nd order linear DE |
| Chapter 6 - Integral Calculus | Q25-Q27: Standard integrals with formula table |
| Chapter 7 - Laplace Transform | Q28-Q30: Definition, standard table, solved problems |
| Quick Revision Page | Summary table of all 7 chapters |
Create a quick reference formula card (one-page PDF cheat sheet)
~/math-question-bank/make_cheatsheet.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.platypus import Table, TableStyle
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
W, H = A4 # 595.27 x 841.89 pts
DARK_BLUE = colors.HexColor("#1F4E79")
MID_BLUE = colors.HexColor("#2E75B6")
LIGHT_BLUE = colors.HexColor("#D6E4F0")
TEAL = colors.HexColor("#0E6655")
DARK_GREEN = colors.HexColor("#1A5C1A")
ORANGE = colors.HexColor("#C0392B")
PALE_YELL = colors.HexColor("#FFF9C4")
PALE_GREEN = colors.HexColor("#E8F5E9")
PALE_BLUE = colors.HexColor("#EAF2FB")
PALE_TEAL = colors.HexColor("#E0F2F1")
PALE_PURP = colors.HexColor("#F3E5F5")
PALE_ORNG = colors.HexColor("#FBE9E7")
PALE_GREY = colors.HexColor("#F5F5F5")
WHITE = colors.white
BLACK = colors.black
GREY = colors.HexColor("#555555")
LGREY = colors.HexColor("#AAAAAA")
OUT = "/home/daytona/workspace/math-question-bank/Math_Formula_Cheatsheet.pdf"
c = canvas.Canvas(OUT, pagesize=A4)
# ββ helpers ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def filled_rect(x, y, w, h, fill, radius=3):
c.setFillColor(fill)
c.roundRect(x, y, w, h, radius, fill=1, stroke=0)
def section_header(x, y, w, title, bg=DARK_BLUE, fg=WHITE):
filled_rect(x, y, w, 13, bg, radius=3)
c.setFillColor(fg)
c.setFont("Helvetica-Bold", 7.5)
c.drawString(x + 4, y + 3.5, title.upper())
def kv(x, y, key, val, key_color=DARK_BLUE, val_color=BLACK, fs=6.5):
c.setFont("Helvetica-Bold", fs)
c.setFillColor(key_color)
c.drawString(x, y, key)
tw = c.stringWidth(key, "Helvetica-Bold", fs)
c.setFont("Helvetica", fs)
c.setFillColor(val_color)
c.drawString(x + tw + 2, y, val)
def formula_row(x, y, w, label, formula, bg=PALE_BLUE, lbl_color=DARK_BLUE):
filled_rect(x, y - 1, w, 9.5, bg, radius=2)
c.setFont("Helvetica-Bold", 6.2)
c.setFillColor(lbl_color)
c.drawString(x + 3, y + 1.5, label)
lw = c.stringWidth(label, "Helvetica-Bold", 6.2)
c.setFont("Helvetica", 6.2)
c.setFillColor(BLACK)
c.drawString(x + lw + 6, y + 1.5, formula)
def plain_row(x, y, w, text, bg=WHITE, fs=6.0, fc=BLACK):
filled_rect(x, y - 1, w, 9, bg, radius=2)
c.setFont("Helvetica", fs)
c.setFillColor(fc)
c.drawString(x + 3, y + 1.3, text)
def two_col_row(x, y, w, left, right, bg=WHITE, fs=6.0):
filled_rect(x, y - 1, w, 9, bg, radius=2)
c.setFont("Helvetica", fs)
c.setFillColor(BLACK)
c.drawString(x + 3, y + 1.3, left)
c.drawRightString(x + w - 3, y + 1.3, right)
def box_outline(x, y, w, h, stroke=MID_BLUE, lw=0.5):
c.setStrokeColor(stroke)
c.setLineWidth(lw)
c.roundRect(x, y, w, h, 3, fill=0, stroke=1)
# ββ TITLE BAR ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
margin = 8 * mm
col_gap = 3 * mm
page_w = W - 2 * margin # usable width
filled_rect(margin, H - 20*mm, page_w, 16*mm, DARK_BLUE, radius=5)
c.setFillColor(WHITE)
c.setFont("Helvetica-Bold", 16)
c.drawCentredString(W/2, H - 13*mm, "REMEDIAL MATHEMATICS β FORMULA CHEAT SHEET")
c.setFont("Helvetica", 8)
c.drawCentredString(W/2, H - 18.5*mm, "DPH-106 | Pharm. D Year 1 | Atam Institute of Pharmacy, Om Sterling Global University")
top = H - 22*mm # top of content area
bot = 8*mm # bottom margin
# We'll lay out 3 columns
col_w = (page_w - 2*col_gap) / 3
c1x = margin
c2x = margin + col_w + col_gap
c3x = margin + 2*(col_w + col_gap)
# row height constants
RH = 10 # standard formula row height
SH = 14 # section header height
GAP = 2 # gap between rows
# ββ COLUMN 1 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cy = top # current y (top of next element)
# 1A: MATRICES
section_header(c1x, cy - SH, col_w, "1. Matrices & Determinants", DARK_BLUE)
cy -= SH + GAP
rows_m = [
("Order", "Rows x Columns"),
("A + B", "Add element-by-element"),
("k*A", "Multiply each element by k"),
("det[a,b;c,d]", "= ad - bc"),
("A\u207b\u00b9", "= Adj(A) / det(A)"),
("Adj(A)", "Transpose of cofactor matrix"),
("Cramer: x", "= Dx / D, y = Dy / D, z = Dz / D"),
("Partial Frac", "A/(x-a) + B/(x-b)"),
]
bgs = [PALE_BLUE, WHITE] * 10
for i, (k, v) in enumerate(rows_m):
formula_row(c1x, cy - RH, col_w, k, v, bg=bgs[i])
cy -= RH + GAP
cy -= 3
# 1B: TRIGONOMETRY
section_header(c1x, cy - SH, col_w, "3. Trigonometry", colors.HexColor("#6A0DAD"))
cy -= SH + GAP
rows_t = [
("sin\u00b2x + cos\u00b2x", "= 1"),
("1 + tan\u00b2x", "= sec\u00b2x"),
("1 + cot\u00b2x", "= cosec\u00b2x"),
("sin(A\u00b1B)", "= sinA cosB \u00b1 cosA sinB"),
("cos(A\u00b1B)", "= cosA cosB \u2213 sinA sinB"),
("tan(A-B)", "= (tanA - tanB)/(1 + tanA*tanB)"),
("cosA+cosB", "= 2cos[(A+B)/2]cos[(A-B)/2]"),
("sin2A", "= 2sinA cosA"),
("cos2A", "= cos\u00b2A - sin\u00b2A"),
]
bgs2 = [PALE_PURP, WHITE] * 10
for i, (k, v) in enumerate(rows_t):
formula_row(c1x, cy - RH, col_w, k, v, bg=bgs2[i], lbl_color=colors.HexColor("#6A0DAD"))
cy -= RH + GAP
# ββ COLUMN 2 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cy = top
# 2A: DIFFERENTIAL CALCULUS
section_header(c2x, cy - SH, col_w, "4. Differential Calculus", TEAL)
cy -= SH + GAP
rows_d = [
("d/dx [x\u207f]", "= n\u00b7x^(n-1)"),
("d/dx [e\u02e3]", "= e\u02e3"),
("d/dx [aΛ£]", "= aΛ£ ln(a)"),
("d/dx [ln x]", "= 1/x"),
("d/dx [sin x]", "= cos x"),
("d/dx [cos x]", "= -sin x"),
("d/dx [tan x]", "= sec\u00b2 x"),
("d/dx [cot x]", "= -cosec\u00b2 x"),
("d/dx [sec x]", "= sec x tan x"),
("d/dx [cosec x]", "= -cosec x cot x"),
("Product Rule", "d/dx[uv] = u v' + v u'"),
("Quotient Rule", "d/dx[u/v] = (v u' - u v')/v\u00b2"),
("Chain Rule", "dy/dx = (dy/du)*(du/dx)"),
]
bgs3 = [PALE_TEAL, WHITE] * 10
for i, (k, v) in enumerate(rows_d):
formula_row(c2x, cy - RH, col_w, k, v, bg=bgs3[i], lbl_color=TEAL)
cy -= RH + GAP
cy -= 3
# 2B: INTEGRAL CALCULUS
section_header(c2x, cy - SH, col_w, "6. Integral Calculus", DARK_GREEN)
cy -= SH + GAP
rows_i = [
("\u222b x\u207f dx", "= x^(n+1)/(n+1) + C"),
("\u222b 1/x dx", "= ln|x| + C"),
("\u222b e\u02e3 dx", "= e\u02e3 + C"),
("\u222b a\u02e3 dx", "= a\u02e3/ln(a) + C"),
("\u222b sin x dx", "= -cos x + C"),
("\u222b cos x dx", "= sin x + C"),
("\u222b sec\u00b2x dx", "= tan x + C"),
("\u222b cosec\u00b2x dx", "= -cot x + C"),
("\u222b sec x tan x dx", "= sec x + C"),
("\u222b 1/\u221a(a\u00b2-x\u00b2) dx", "= sin\u207b\u00b9(x/a) + C"),
]
bgs4 = [PALE_GREEN, WHITE] * 10
for i, (k, v) in enumerate(rows_i):
formula_row(c2x, cy - RH, col_w, k, v, bg=bgs4[i], lbl_color=DARK_GREEN)
cy -= RH + GAP
# ββ COLUMN 3 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cy = top
# 3A: DIFFERENTIAL EQUATIONS
section_header(c3x, cy - SH, col_w, "5. Differential Equations", ORANGE)
cy -= SH + GAP
rows_de = [
("Order", "Order of highest derivative"),
("Degree", "Power of highest derivative"),
("Variables Sep.", "f(y)dy = g(x)dx => integrate both"),
("Homogeneous", "Put y=vx, dy/dx = v + x dv/dx"),
("Linear 1st order", "dy/dx + P(x)y = Q(x)"),
("IF", "= e^(INT P dx)"),
("Solution", "y*IF = INT(Q*IF)dx + C"),
("2nd order AE", "am\u00b2 + bm + c = 0"),
("Real roots m1,m2", "y = C1 e^(m1x) + C2 e^(m2x)"),
("Equal roots m", "y = (C1 + C2 x)e^(mx)"),
("Complex m=p\u00b1qi", "y = e^(px)[C1cos(qx)+C2sin(qx)]"),
("PI for e^(ax)", "e^(ax) / f(a) [if f(a)\u22600]"),
]
bgs5 = [PALE_ORNG, WHITE] * 10
for i, (k, v) in enumerate(rows_de):
formula_row(c3x, cy - RH, col_w, k, v, bg=bgs5[i], lbl_color=ORANGE)
cy -= RH + GAP
cy -= 3
# 3B: LAPLACE TRANSFORM
section_header(c3x, cy - SH, col_w, "7. Laplace Transform", colors.HexColor("#5D4037"))
cy -= SH + GAP
rows_l = [
("Definition", "L{f(t)} = \u222b\u2080^\u221e e^(-st) f(t) dt"),
("L{1}", "= 1/s"),
("L{t\u207f}", "= n!/s^(n+1)"),
("L{e^(at)}", "= 1/(s-a)"),
("L{sin(at)}", "= a/(s\u00b2+a\u00b2)"),
("L{cos(at)}", "= s/(s\u00b2+a\u00b2)"),
("L{t\u207f e^(at)}", "= n!/(s-a)^(n+1)"),
("L{e^(at)sin(bt)}", "= b/[(s-a)\u00b2+b\u00b2]"),
("L{e^(at)cos(bt)}", "= (s-a)/[(s-a)\u00b2+b\u00b2]"),
("Linearity", "L{af+bg} = aF(s)+bG(s)"),
("1st shift thm", "L{e^(at)f(t)} = F(s-a)"),
]
bgs6 = [colors.HexColor("#EFEBE9"), WHITE] * 10
for i, (k, v) in enumerate(rows_l):
formula_row(c3x, cy - RH, col_w, k, v, bg=bgs6[i], lbl_color=colors.HexColor("#5D4037"))
cy -= RH + GAP
# ββ ANALYTICAL GEOMETRY STRIP (full width at bottom) βββββββββββββββββββββ
# find lowest cy among all 3 columns (approximate)
strip_top = 42*mm # fixed y position from bottom
strip_h = 33*mm
filled_rect(margin, bot + 2, page_w, strip_h, colors.HexColor("#EAF2FB"), radius=4)
box_outline(margin, bot + 2, page_w, strip_h, MID_BLUE, lw=0.8)
section_header(margin + 2, bot + 2 + strip_h - SH - 2, page_w - 4,
"2. Analytical Geometry", MID_BLUE)
# split into 3 sub-columns inside the strip
sub_w = (page_w - 4 - 2*col_gap) / 3
sx1 = margin + 2
sx2 = sx1 + sub_w + col_gap
sx3 = sx2 + sub_w + col_gap
sy = bot + 2 + strip_h - SH - 2 - GAP
geo_rows_1 = [
("Distance", "d = \u221a[(x2-x1)\u00b2+(y2-y1)\u00b2]"),
("Midpoint", "M = ((x1+x2)/2, (y1+y2)/2)"),
("Area of \u25b3", "(1/2)|x1(y2-y3)+x2(y3-y1)+x3(y1-y2)|"),
]
geo_rows_2 = [
("Slope (m)", "m = (y2-y1)/(x2-x1)"),
("Line (slope-pt)", "y - y1 = m(x - x1)"),
("Slope-intercept", "y = mx + c"),
]
geo_rows_3 = [
("Quadrant I", "x>0, y>0"),
("Quadrant II", "x<0, y>0"),
("Quadrant III", "x<0, y<0"),
("Quadrant IV", "x>0, y<0"),
]
for i, (k, v) in enumerate(geo_rows_1):
formula_row(sx1, sy - RH*(i+1) - GAP*i, sub_w, k, v, bg=PALE_BLUE, lbl_color=MID_BLUE)
for i, (k, v) in enumerate(geo_rows_2):
formula_row(sx2, sy - RH*(i+1) - GAP*i, sub_w, k, v, bg=PALE_BLUE, lbl_color=MID_BLUE)
for i, (k, v) in enumerate(geo_rows_3):
formula_row(sx3, sy - RH*(i+1) - GAP*i, sub_w, k, v, bg=PALE_BLUE, lbl_color=MID_BLUE)
# ββ FOOTER ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
c.setFillColor(LGREY)
c.setFont("Helvetica-Oblique", 6)
c.drawCentredString(W/2, bot - 3, "Remedial Mathematics DPH-106 | Quick Reference Card | Om Sterling Global University")
# ββ BORDER around entire page βββββββββββββββββββββββββββββββββββββββββββββ
c.setStrokeColor(DARK_BLUE)
c.setLineWidth(1.5)
c.roundRect(4, 4, W-8, H-8, 6, fill=0, stroke=1)
c.save()
print("PDF written to:", OUT)
cd /home/daytona/workspace/math-question-bank && python3 make_cheatsheet.py 2>&1
python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/math-question-bank/Math_Formula_Cheatsheet.pdf') print('Pages:', len(r.pages)) import os print('Size:', os.path.getsize('/home/daytona/workspace/math-question-bank/Math_Formula_Cheatsheet.pdf'), 'bytes') "
Math Formula Cheatsheet
PDF Document Β· PDF
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| Matrices & Determinants - Order, det, Adj, Aβ»ΒΉ, Cramer's Rule, Partial Fractions | Differential Calculus - All 10 standard derivatives, Product/Quotient/Chain rules | Differential Equations - Order/Degree, Separable, Linear 1st order, 2nd order (CF+PI) |
| Trigonometry - Pythagorean identities, Addition formulas, Sum-to-product, Double angle | Integral Calculus - 10 standard integrals (power, trig, exp, log, inverse trig) | Laplace Transform - Definition + 11 standard formulas including shift theorem |
THIS FILE IS NOT OPENING
python3 -c "import reportlab; print(reportlab.Version)"
python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/math-question-bank/Math_Formula_Cheatsheet.pdf') print('Pages:', len(r.pages)) print('Text sample:', r.pages[0].extract_text()[:200]) "
cd /home/daytona/workspace/math-question-bank && python3 -c " from reportlab.lib.pagesizes import A4 from reportlab.lib import colors from reportlab.pdfgen import canvas from reportlab.lib.units import mm W, H = A4 OUT = 'Math_Formula_Cheatsheet_v2.pdf' c = canvas.Canvas(OUT, pagesize=A4) c._doc.info.producer = 'ReportLab' c._doc.info.creator = 'ReportLab' # force PDF 1.4 compatibility c.setPageCompression(0) # ---- COLOR PALETTE ---- DARK_BLUE = colors.HexColor('#1F4E79') MID_BLUE = colors.HexColor('#2E75B6') TEAL = colors.HexColor('#0E6655') DARK_GREEN = colors.HexColor('#155724') ORANGE = colors.HexColor('#C0392B') PURPLE = colors.HexColor('#6A0DAD') BROWN = colors.HexColor('#5D4037') WHITE = colors.white BLACK = colors.black PALE_BLUE = colors.HexColor('#EAF2FB') PALE_TEAL = colors.HexColor('#E0F2F1') PALE_GREEN = colors.HexColor('#E8F5E9') PALE_ORG = colors.HexColor('#FBE9E7') PALE_PURP = colors.HexColor('#F3E5F5') PALE_BRN = colors.HexColor('#EFEBE9') PALE_GREY = colors.HexColor('#F5F5F5') margin = 8*mm cw = (W - 2*margin - 4*mm) / 3 # 3 column widths c1x = margin c2x = margin + cw + 2*mm c3x = margin + 2*(cw + 2*mm) RH = 10 # row height SH = 12 # section header height G = 1.5 # gap def hdr(x, y, w, title, bg): c.setFillColor(bg) c.roundRect(x, y, w, SH, 2, fill=1, stroke=0) c.setFillColor(WHITE) c.setFont('Helvetica-Bold', 7) c.drawString(x+3, y+3, title.upper()) def row(x, y, w, label, formula, pale): c.setFillColor(pale) c.roundRect(x, y, w, RH-1, 2, fill=1, stroke=0) c.setFont('Helvetica-Bold', 6) c.setFillColor(BLACK) c.drawString(x+3, y+2, label) lw = c.stringWidth(label, 'Helvetica-Bold', 6) c.setFont('Helvetica', 6) c.drawString(x+lw+5, y+2, formula) def alt(i): return PALE_GREY if i%2==0 else WHITE TOP = H - 22*mm # ---- TITLE ---- c.setFillColor(DARK_BLUE) c.roundRect(margin, H-20*mm, W-2*margin, 16*mm, 4, fill=1, stroke=0) c.setFillColor(WHITE) c.setFont('Helvetica-Bold', 14) c.drawCentredString(W/2, H-13*mm, 'REMEDIAL MATHEMATICS - FORMULA CHEAT SHEET') c.setFont('Helvetica', 7.5) c.drawCentredString(W/2, H-18*mm, 'DPH-106 | Pharm. D Year 1 | Atam Institute of Pharmacy, Om Sterling Global University') # ======= COLUMN 1 ======= cy = TOP # MATRICES hdr(c1x, cy-SH, cw, '1. Matrices & Determinants', DARK_BLUE); cy -= SH+G mrows = [ ('Order','Rows x Columns'), ('A + B','Add corresponding elements'), ('k * A','Multiply each element by k'), ('det[a,b;c,d]','= ad - bc'), ('A inverse','= Adj(A) / det(A)'), ('Adj(A)','Transpose of Cofactor Matrix'), ('Cramer x','= Dx/D, y = Dy/D, z = Dz/D'), ('Partial Frac','A/(x-a) + B/(x-b) + ...'), ] for i,(k,v) in enumerate(mrows): row(c1x, cy-RH, cw, k, v, alt(i)); cy -= RH+G cy -= 4 # TRIGONOMETRY hdr(c1x, cy-SH, cw, '3. Trigonometry', PURPLE); cy -= SH+G trows = [ ('sin2x+cos2x','= 1'), ('1+tan2x','= sec2x'), ('sin(A+B)','= sinA cosB + cosA sinB'), ('cos(A+B)','= cosA cosB - sinA sinB'), ('tan(A-B)','= (tanA-tanB)/(1+tanA*tanB)'), ('cosA+cosB','= 2cos[(A+B)/2]cos[(A-B)/2]'), ('sin 2A','= 2 sinA cosA'), ('cos 2A','= cos2A - sin2A'), ] for i,(k,v) in enumerate(trows): row(c1x, cy-RH, cw, k, v, alt(i)); cy -= RH+G # ======= COLUMN 2 ======= cy = TOP # DIFFERENTIAL CALCULUS hdr(c2x, cy-SH, cw, '4. Differential Calculus', TEAL); cy -= SH+G drows = [ ('d/dx [xn]','= n * x^(n-1)'), ('d/dx [ex]','= ex'), ('d/dx [ax]','= ax * ln(a)'), ('d/dx [ln x]','= 1/x'), ('d/dx [sin x]','= cos x'), ('d/dx [cos x]','= -sin x'), ('d/dx [tan x]','= sec2 x'), ('d/dx [cot x]','= -cosec2 x'), ('d/dx [sec x]','= sec x * tan x'), ('d/dx [cosec x]','= -cosec x * cot x'), ('Product Rule','d/dx[uv] = u*v\' + v*u\''), ('Quotient Rule','(v*u\' - u*v\') / v2'), ('Chain Rule','dy/dx = (dy/du)*(du/dx)'), ] for i,(k,v) in enumerate(drows): row(c2x, cy-RH, cw, k, v, alt(i)); cy -= RH+G cy -= 4 # INTEGRAL CALCULUS hdr(c2x, cy-SH, cw, '6. Integral Calculus', DARK_GREEN); cy -= SH+G irows = [ ('INT xn dx','= x^(n+1)/(n+1) + C'), ('INT 1/x dx','= ln|x| + C'), ('INT ex dx','= ex + C'), ('INT ax dx','= ax/ln(a) + C'), ('INT sin x dx','= -cos x + C'), ('INT cos x dx','= sin x + C'), ('INT sec2x dx','= tan x + C'), ('INT cosec2x dx','= -cot x + C'), ('INT sec x tan x dx','= sec x + C'), ] for i,(k,v) in enumerate(irows): row(c2x, cy-RH, cw, k, v, alt(i)); cy -= RH+G # ======= COLUMN 3 ======= cy = TOP # DIFFERENTIAL EQUATIONS hdr(c3x, cy-SH, cw, '5. Differential Equations', ORANGE); cy -= SH+G derows = [ ('Order','Highest derivative order'), ('Degree','Power of highest derivative'), ('Var. Separable','f(y)dy = g(x)dx, integrate both'), ('Homogeneous','Sub y=vx, dy/dx = v+x*dv/dx'), ('Linear 1st order','dy/dx + P(x)y = Q(x)'), ('Int. Factor','e^(INT P dx)'), ('Solution','y*IF = INT(Q*IF)dx + C'), ('2nd order AE','am2 + bm + c = 0'), ('Roots m1,m2 real','y = C1*e^(m1x) + C2*e^(m2x)'), ('Roots equal m','y = (C1 + C2*x)*e^(mx)'), ('Complex p+qi','e^(px)[C1cos(qx)+C2sin(qx)]'), ('PI for e^(ax)','= e^(ax)/f(a) [f(a) != 0]'), ] for i,(k,v) in enumerate(derows): row(c3x, cy-RH, cw, k, v, alt(i)); cy -= RH+G cy -= 4 # LAPLACE TRANSFORM hdr(c3x, cy-SH, cw, '7. Laplace Transform', BROWN); cy -= SH+G lrows = [ ('Definition','L{f(t)} = INT(0 to inf) e^(-st) f(t) dt'), ('L{1}','= 1/s'), ('L{tn}','= n! / s^(n+1)'), ('L{e^at}','= 1/(s-a)'), ('L{sin(at)}','= a/(s2+a2)'), ('L{cos(at)}','= s/(s2+a2)'), ('L{e^at sin(bt)}','= b/[(s-a)2+b2]'), ('L{e^at cos(bt)}','= (s-a)/[(s-a)2+b2]'), ('Linearity','L{af+bg} = aF(s)+bG(s)'), ('First Shift','L{e^at f(t)} = F(s-a)'), ] for i,(k,v) in enumerate(lrows): row(c3x, cy-RH, cw, k, v, alt(i)); cy -= RH+G # ======= ANALYTICAL GEOMETRY (full width strip at bottom) ======= strip_h = 36*mm sy = 12*mm c.setFillColor(PALE_BLUE) c.roundRect(margin, sy, W-2*margin, strip_h, 3, fill=1, stroke=0) c.setStrokeColor(MID_BLUE); c.setLineWidth(0.8) c.roundRect(margin, sy, W-2*margin, strip_h, 3, fill=0, stroke=1) hdr(margin+2, sy+strip_h-SH-2, W-2*margin-4, '2. Analytical Geometry', MID_BLUE) sw = (W - 2*margin - 4 - 4*mm) / 3 sx1 = margin + 2 sx2 = sx1 + sw + 2*mm sx3 = sx2 + sw + 2*mm base = sy + strip_h - SH - G - 2 geo1 = [ ('Distance','d = sqrt[(x2-x1)2+(y2-y1)2]'), ('Midpoint','M = ((x1+x2)/2,(y1+y2)/2)'), ('Area of Triangle','(1/2)|x1(y2-y3)+x2(y3-y1)+x3(y1-y2)|'), ] geo2 = [ ('Slope m','= (y2-y1)/(x2-x1)'), ('Point-Slope','y - y1 = m(x - x1)'), ('Slope-Intercept','y = mx + c'), ] geo3 = [ ('Quadrant I','x>0, y>0 (+,+)'), ('Quadrant II','x<0, y>0 (-,+)'), ('Quadrant III','x<0, y<0 (-,-)'), ('Quadrant IV','x>0, y<0 (+,-)'), ] for i,(k,v) in enumerate(geo1): row(sx1, base-(i+1)*RH-i*G, sw, k, v, alt(i)) for i,(k,v) in enumerate(geo2): row(sx2, base-(i+1)*RH-i*G, sw, k, v, alt(i)) for i,(k,v) in enumerate(geo3): row(sx3, base-(i+1)*RH-i*G, sw, k, v, alt(i)) # ---- PAGE BORDER ---- c.setStrokeColor(DARK_BLUE); c.setLineWidth(1.5) c.roundRect(4, 4, W-8, H-8, 6, fill=0, stroke=1) # ---- FOOTER ---- c.setFillColor(colors.HexColor('#999999')) c.setFont('Helvetica-Oblique', 5.5) c.drawCentredString(W/2, 7, 'Remedial Mathematics DPH-106 | Quick Reference Cheat Sheet | Om Sterling Global University') c.showPage() c.save() print('Done:', OUT) " 2>&1
~/math-question-bank/Math_Formula_Cheatsheet.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Remedial Mathematics β Formula Cheat Sheet</title>
<style>
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: Arial, sans-serif; font-size: 11px; background: #fff; color: #111; }
@media print {
body { font-size: 9px; }
.page { page-break-after: avoid; width: 210mm; min-height: 297mm; padding: 6mm; }
}
.page { width: 210mm; min-height: 297mm; padding: 6mm; margin: auto; border: 2px solid #1F4E79; border-radius: 6px; }
/* TITLE */
.title-bar { background: #1F4E79; color: #fff; text-align: center; padding: 6px 4px 4px; border-radius: 5px; margin-bottom: 5px; }
.title-bar h1 { font-size: 15px; letter-spacing: 1px; }
.title-bar p { font-size: 8px; color: #cde; margin-top: 2px; }
/* 3-COLUMN GRID */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 4px; }
/* SECTION */
.section { border-radius: 4px; overflow: hidden; }
.sec-hdr { font-size: 8px; font-weight: bold; color: #fff; padding: 3px 5px; letter-spacing: 0.5px; text-transform: uppercase; }
.sec-hdr.blue { background: #1F4E79; }
.sec-hdr.teal { background: #0E6655; }
.sec-hdr.green { background: #155724; }
.sec-hdr.orange { background: #C0392B; }
.sec-hdr.purple { background: #6A0DAD; }
.sec-hdr.brown { background: #5D4037; }
.sec-hdr.mid { background: #2E75B6; }
/* FORMULA ROW */
table.ftable { width: 100%; border-collapse: collapse; }
table.ftable tr:nth-child(odd) td { background: #F5F5F5; }
table.ftable tr:nth-child(even) td { background: #fff; }
table.ftable td { padding: 2px 4px; vertical-align: middle; font-size: 9px; }
table.ftable td.lbl { font-weight: bold; white-space: nowrap; width: 35%; }
/* COLORS PER SECTION */
.s-blue table.ftable tr:nth-child(odd) td { background:#EAF2FB; }
.s-teal table.ftable tr:nth-child(odd) td { background:#E0F2F1; }
.s-green table.ftable tr:nth-child(odd) td { background:#E8F5E9; }
.s-orange table.ftable tr:nth-child(odd) td { background:#FBE9E7; }
.s-purple table.ftable tr:nth-child(odd) td { background:#F3E5F5; }
.s-brown table.ftable tr:nth-child(odd) td { background:#EFEBE9; }
.s-mid table.ftable tr:nth-child(odd) td { background:#EAF2FB; }
/* GEO STRIP */
.geo-strip { background:#EAF2FB; border: 1px solid #2E75B6; border-radius:4px; overflow:hidden; }
.geo-strip .grid3 { margin:0; padding:3px; gap:4px; }
/* FOOTER */
.footer { text-align:center; font-size:7px; color:#999; margin-top:4px; font-style:italic; }
</style>
</head>
<body>
<div class="page">
<!-- TITLE -->
<div class="title-bar">
<h1>REMEDIAL MATHEMATICS — FORMULA CHEAT SHEET</h1>
<p>DPH-106 | Pharm. D Year 1 | Atam Institute of Pharmacy, Om Sterling Global University</p>
</div>
<!-- 3 COLUMNS -->
<div class="grid3">
<!-- COL 1 -->
<div>
<!-- MATRICES -->
<div class="section s-blue" style="margin-bottom:4px">
<div class="sec-hdr blue">1. Matrices & Determinants</div>
<table class="ftable">
<tr><td class="lbl">Order</td><td>Rows × Columns</td></tr>
<tr><td class="lbl">A + B</td><td>Add corresponding elements</td></tr>
<tr><td class="lbl">k · A</td><td>Multiply every element by k</td></tr>
<tr><td class="lbl">det[a,b;c,d]</td><td>= ad − bc</td></tr>
<tr><td class="lbl">A<sup>−1</sup></td><td>= Adj(A) / det(A)</td></tr>
<tr><td class="lbl">Adj(A)</td><td>Transpose of Cofactor Matrix</td></tr>
<tr><td class="lbl">Cramer x</td><td>= D<sub>x</sub>/D, y = D<sub>y</sub>/D, z = D<sub>z</sub>/D</td></tr>
<tr><td class="lbl">Partial Frac</td><td>A/(x−a) + B/(x−b)</td></tr>
</table>
</div>
<!-- TRIGONOMETRY -->
<div class="section s-purple">
<div class="sec-hdr purple">3. Trigonometry</div>
<table class="ftable">
<tr><td class="lbl">sin²x + cos²x</td><td>= 1</td></tr>
<tr><td class="lbl">1 + tan²x</td><td>= sec²x</td></tr>
<tr><td class="lbl">sin(A±B)</td><td>= sinA cosB ± cosA sinB</td></tr>
<tr><td class="lbl">cos(A±B)</td><td>= cosA cosB ∓ sinA sinB</td></tr>
<tr><td class="lbl">tan(A−B)</td><td>= (tanA−tanB)/(1+tanA·tanB)</td></tr>
<tr><td class="lbl">cosA + cosB</td><td>= 2cos[(A+B)/2]cos[(A−B)/2]</td></tr>
<tr><td class="lbl">sin 2A</td><td>= 2 sinA cosA</td></tr>
<tr><td class="lbl">cos 2A</td><td>= cos²A − sin²A</td></tr>
</table>
</div>
</div>
<!-- COL 2 -->
<div>
<!-- DIFFERENTIAL CALCULUS -->
<div class="section s-teal" style="margin-bottom:4px">
<div class="sec-hdr teal">4. Differential Calculus</div>
<table class="ftable">
<tr><td class="lbl">d/dx [x<sup>n</sup>]</td><td>= n · x<sup>n−1</sup></td></tr>
<tr><td class="lbl">d/dx [e<sup>x</sup>]</td><td>= e<sup>x</sup></td></tr>
<tr><td class="lbl">d/dx [a<sup>x</sup>]</td><td>= a<sup>x</sup> · ln(a)</td></tr>
<tr><td class="lbl">d/dx [ln x]</td><td>= 1/x</td></tr>
<tr><td class="lbl">d/dx [sin x]</td><td>= cos x</td></tr>
<tr><td class="lbl">d/dx [cos x]</td><td>= −sin x</td></tr>
<tr><td class="lbl">d/dx [tan x]</td><td>= sec² x</td></tr>
<tr><td class="lbl">d/dx [cot x]</td><td>= −cosec² x</td></tr>
<tr><td class="lbl">d/dx [sec x]</td><td>= sec x · tan x</td></tr>
<tr><td class="lbl">d/dx [cosec x]</td><td>= −cosec x · cot x</td></tr>
<tr><td class="lbl">Product Rule</td><td>d/dx[uv] = u·v′ + v·u′</td></tr>
<tr><td class="lbl">Quotient Rule</td><td>(v·u′ − u·v′) / v²</td></tr>
<tr><td class="lbl">Chain Rule</td><td>dy/dx = (dy/du)·(du/dx)</td></tr>
</table>
</div>
<!-- INTEGRAL CALCULUS -->
<div class="section s-green">
<div class="sec-hdr green">6. Integral Calculus</div>
<table class="ftable">
<tr><td class="lbl">∫ x<sup>n</sup> dx</td><td>= x<sup>n+1</sup>/(n+1) + C</td></tr>
<tr><td class="lbl">∫ 1/x dx</td><td>= ln|x| + C</td></tr>
<tr><td class="lbl">∫ e<sup>x</sup> dx</td><td>= e<sup>x</sup> + C</td></tr>
<tr><td class="lbl">∫ a<sup>x</sup> dx</td><td>= a<sup>x</sup>/ln(a) + C</td></tr>
<tr><td class="lbl">∫ sin x dx</td><td>= −cos x + C</td></tr>
<tr><td class="lbl">∫ cos x dx</td><td>= sin x + C</td></tr>
<tr><td class="lbl">∫ sec²x dx</td><td>= tan x + C</td></tr>
<tr><td class="lbl">∫ cosec²x dx</td><td>= −cot x + C</td></tr>
<tr><td class="lbl">∫ sec x tan x dx</td><td>= sec x + C</td></tr>
</table>
</div>
</div>
<!-- COL 3 -->
<div>
<!-- DIFFERENTIAL EQUATIONS -->
<div class="section s-orange" style="margin-bottom:4px">
<div class="sec-hdr orange">5. Differential Equations</div>
<table class="ftable">
<tr><td class="lbl">Order</td><td>Highest derivative order</td></tr>
<tr><td class="lbl">Degree</td><td>Power of highest derivative</td></tr>
<tr><td class="lbl">Var. Separable</td><td>f(y)dy = g(x)dx → integrate both</td></tr>
<tr><td class="lbl">Homogeneous</td><td>Sub y=vx, dy/dx = v + x·dv/dx</td></tr>
<tr><td class="lbl">Linear 1st order</td><td>dy/dx + P(x)y = Q(x)</td></tr>
<tr><td class="lbl">Int. Factor (IF)</td><td>= e<sup>∫P dx</sup></td></tr>
<tr><td class="lbl">Solution</td><td>y · IF = ∫(Q · IF)dx + C</td></tr>
<tr><td class="lbl">2nd order AE</td><td>am² + bm + c = 0</td></tr>
<tr><td class="lbl">Real roots m<sub>1</sub>,m<sub>2</sub></td><td>y = C<sub>1</sub>e<sup>m<sub>1</sub>x</sup> + C<sub>2</sub>e<sup>m<sub>2</sub>x</sup></td></tr>
<tr><td class="lbl">Equal roots m</td><td>y = (C<sub>1</sub> + C<sub>2</sub>x)e<sup>mx</sup></td></tr>
<tr><td class="lbl">Complex p±qi</td><td>e<sup>px</sup>[C<sub>1</sub>cos(qx)+C<sub>2</sub>sin(qx)]</td></tr>
<tr><td class="lbl">PI for e<sup>ax</sup></td><td>= e<sup>ax</sup>/f(a) [f(a)≠0]</td></tr>
</table>
</div>
<!-- LAPLACE -->
<div class="section s-brown">
<div class="sec-hdr brown">7. Laplace Transform</div>
<table class="ftable">
<tr><td class="lbl">Definition</td><td>L{f(t)} = ∫<sub>0</sub><sup>∞</sup> e<sup>−st</sup> f(t) dt</td></tr>
<tr><td class="lbl">L{1}</td><td>= 1/s</td></tr>
<tr><td class="lbl">L{t<sup>n</sup>}</td><td>= n! / s<sup>n+1</sup></td></tr>
<tr><td class="lbl">L{e<sup>at</sup>}</td><td>= 1/(s−a)</td></tr>
<tr><td class="lbl">L{sin(at)}</td><td>= a/(s²+a²)</td></tr>
<tr><td class="lbl">L{cos(at)}</td><td>= s/(s²+a²)</td></tr>
<tr><td class="lbl">L{e<sup>at</sup>sin(bt)}</td><td>= b/[(s−a)²+b²]</td></tr>
<tr><td class="lbl">L{e<sup>at</sup>cos(bt)}</td><td>= (s−a)/[(s−a)²+b²]</td></tr>
<tr><td class="lbl">Linearity</td><td>L{af+bg} = aF(s)+bG(s)</td></tr>
<tr><td class="lbl">First Shift</td><td>L{e<sup>at</sup>f(t)} = F(s−a)</td></tr>
</table>
</div>
</div>
</div><!-- end grid3 -->
<!-- ANALYTICAL GEOMETRY STRIP -->
<div class="geo-strip">
<div class="sec-hdr mid">2. Analytical Geometry</div>
<div class="grid3" style="padding:3px;">
<table class="ftable s-mid">
<tr><td class="lbl">Distance</td><td>d = √[(x<sub>2</sub>−x<sub>1</sub>)²+(y<sub>2</sub>−y<sub>1</sub>)²]</td></tr>
<tr><td class="lbl">Midpoint</td><td>M = ((x<sub>1</sub>+x<sub>2</sub>)/2, (y<sub>1</sub>+y<sub>2</sub>)/2)</td></tr>
<tr><td class="lbl">Area of ▵</td><td>½|x<sub>1</sub>(y<sub>2</sub>−y<sub>3</sub>)+x<sub>2</sub>(y<sub>3</sub>−y<sub>1</sub>)+x<sub>3</sub>(y<sub>1</sub>−y<sub>2</sub>)|</td></tr>
</table>
<table class="ftable s-mid">
<tr><td class="lbl">Slope m</td><td>= (y<sub>2</sub>−y<sub>1</sub>) / (x<sub>2</sub>−x<sub>1</sub>)</td></tr>
<tr><td class="lbl">Point-Slope</td><td>y − y<sub>1</sub> = m(x − x<sub>1</sub>)</td></tr>
<tr><td class="lbl">Slope-Intercept</td><td>y = mx + c</td></tr>
</table>
<table class="ftable s-mid">
<tr><td class="lbl">Quadrant I</td><td>x > 0, y > 0 (+,+)</td></tr>
<tr><td class="lbl">Quadrant II</td><td>x < 0, y > 0 (−,+)</td></tr>
<tr><td class="lbl">Quadrant III</td><td>x < 0, y < 0 (−,−)</td></tr>
<tr><td class="lbl">Quadrant IV</td><td>x > 0, y < 0 (+,−)</td></tr>
</table>
</div>
</div>
<div class="footer">Remedial Mathematics DPH-106 | Quick Reference Cheat Sheet | Om Sterling Global University | Open in any browser → Ctrl+P to print</div>
</div>
</body>
</html>
cd /home/daytona/workspace/math-question-bank && python3 /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-to pdf Math_Formula_Cheatsheet.html 2>&1 && ls -lh *.pdf *.html 2>&1
Math Formula Cheatsheet v2
PDF Document Β· PDF
Math Formula Cheatsheet
HTML File Β· HTML
Math Formula Cheatsheet
PDF Document Β· PDF
Math_Formula_Cheatsheet.html in Chrome or Firefox