CAN YOU GIVR SOLUTION OF MATH

Of course! I can help you solve math problems.
Please share the math problem you'd like me to solve, and I'll work through it step by step. I can help with:
  • Arithmetic (addition, subtraction, multiplication, division)
  • Algebra (equations, inequalities, polynomials)
  • Geometry (areas, volumes, angles, proofs)
  • Trigonometry (sin, cos, tan, identities)
  • Calculus (limits, derivatives, integrals)
  • Statistics & Probability
  • Linear Algebra (matrices, vectors)
  • Number Theory
  • Word Problems
Go ahead and type or paste your problem!
attachment
attachment
attachment
attachment
attachment
attachment
attachment

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

I've analyzed all your exam papers from Om Sterling Global University - Remedial Mathematics (DPH-106). Below is a complete Question Bank with Full Solutions covering all important chapters - designed to be studied in one day!

πŸ“š REMEDIAL MATHEMATICS - QUESTION BANK WITH SOLUTIONS

(Based on Your Actual Exam Papers - DPH-106)


CHAPTER 1: MATRICES AND DETERMINANTS


Q1. Define Matrix and its Order.

Answer: A Matrix is a rectangular arrangement of numbers (real or complex) arranged in rows and columns, enclosed in brackets.
Order of a matrix = Number of rows Γ— Number of columns
Example:
A = [1  2  3]
    [4  5  6]
This matrix has 2 rows and 3 columns, so its order is 2Γ—3.

Q2. Add a Note on Types of Matrices.

Answer:
TypeDescriptionExample
Row MatrixOnly 1 row[1, 2, 3]
Column MatrixOnly 1 column[1; 2; 3]
Square MatrixRows = Columns2Γ—2, 3Γ—3
Zero MatrixAll elements = 0[0,0;0,0]
Identity Matrix (I)Diagonal = 1, rest = 0[1,0;0,1]
Diagonal MatrixNon-diagonal = 0[2,0;0,5]
Symmetric MatrixA = A^T-
Skew-SymmetricA = -A^T-

Q3. State Transpose of a Matrix with Example.

Answer: The Transpose of matrix A (written as A^T) is obtained by interchanging rows and columns.
Example:
If A = [1  2  3]      Then A^T = [1  4]
       [4  5  6]                  [2  5]
                                  [3  6]
Property: (A^T)^T = A

Q4. Write a Note on Operations on Matrices with Example.

Answer: 1. Addition: Add corresponding elements. (Same order required)
[1 2] + [5 6] = [6  8]
[3 4]   [7 8]   [10 12]
2. Subtraction: Subtract corresponding elements.
3. Scalar Multiplication:
2 Γ— [1 2] = [2 4]
    [3 4]   [6 8]
4. Matrix Multiplication: (A is mΓ—n, B is nΓ—p β†’ AB is mΓ—p)
[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]

Q5. Find Adj(A) and A⁻¹ for the matrix:

A = [1  1  1]
    [1  2 -3]
    [2 -1  3]
Step 1 - Find det(A):
det(A) = 1(2Γ—3 - (-3)Γ—(-1)) - 1(1Γ—3 - (-3)Γ—2) + 1(1Γ—(-1) - 2Γ—2)
= 1(6 - 3) - 1(3 + 6) + 1(-1 - 4)
= 1(3) - 1(9) + 1(-5)
= 3 - 9 - 5 = -11
Step 2 - Find Cofactor Matrix:
C₁₁ = +(2Γ—3 - (-3)Γ—(-1)) = +(6-3) = 3 C₁₂ = -(1Γ—3 - (-3)Γ—2) = -(3+6) = -9 C₁₃ = +(1Γ—(-1) - 2Γ—2) = +(-1-4) = -5
C₂₁ = -(1Γ—3 - 1Γ—(-1)) = -(3+1) = -4 Cβ‚‚β‚‚ = +(1Γ—3 - 1Γ—2) = +(3-2) = 1 C₂₃ = -(1Γ—(-1) - 1Γ—2) = -(-1-2) = 3
C₃₁ = +(1Γ—(-3) - 1Γ—2) = +(-3-2) = -5 C₃₂ = -(1Γ—(-3) - 1Γ—1) = -(-3-1) = 4 C₃₃ = +(1Γ—2 - 1Γ—1) = +(2-1) = 1
Cofactor Matrix:
C = [ 3  -9  -5]
    [-4   1   3]
    [-5   4   1]
Step 3 - Adj(A) = Transpose of Cofactor Matrix:
Adj(A) = [ 3  -4  -5]
         [-9   1   4]
         [-5   3   1]
Step 4 - A⁻¹ = Adj(A) / det(A):
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]

Q6. Find Adjoint of Matrix:

A = [ 1   3   4]
    [-1   6   0]
    [ 3   4   2]
det(A) = 1(12-0) - 3(-2-0) + 4(-4-18) = 12 + 6 - 88 = -70
Cofactors: C₁₁ = +(12-0) = 12 C₁₂ = -(-2-0) = 2 C₁₃ = +(-4-18) = -22
C₂₁ = -(6-16) = 10 Cβ‚‚β‚‚ = +(2-12) = -10 C₂₃ = -(4-9) = 5
C₃₁ = +(0-24) = -24 C₃₂ = -(0+4) = -4 C₃₃ = +(6+3) = 9
Adj(A):
Adj(A) = [ 12   10  -24]
         [  2  -10   -4]
         [-22    5    9]

Q7. Solve by Cramer's Rule: 5x - 7y + z = 11, 6x - 8y - z = 15, 3x + 2y - 6z = 7

Setting up:
D = |5  -7   1|
    |6  -8  -1|
    |3   2  -6|
D = 5[(-8)(-6)-(-1)(2)] - (-7)[(6)(-6)-(-1)(3)] + 1[(6)(2)-(-8)(3)]
= 5[48+2] + 7[-36+3] + 1[12+24]
= 5(50) + 7(-33) + 1(36)
= 250 - 231 + 36 = 55
Dx = |11  -7   1|
     |15  -8  -1|
     | 7   2  -6|
Dx = 11[48+2] - (-7)[(-90+7)] + 1[30+56]
= 11(50) + 7(-83) + 86
= 550 - 581 + 86 = 55
Dy = |5  11   1|
     |6  15  -1|
     |3   7  -6|
Dy = 5[(-90+7)] - 11[(-36+3)] + 1[(42-45)]
= 5(-83) - 11(-33) + (-3)
= -415 + 363 - 3 = -55
Dz = |5  -7  11|
     |6  -8  15|
     |3   2   7|
Dz = 5(-56-30) - (-7)(42-45) + 11(12+24)
= 5(-86) + 7(-3) + 11(36)
= -430 - 21 + 396 = -55
Solutions:
  • x = Dx/D = 55/55 = 1
  • y = Dy/D = -55/55 = -1
  • z = Dz/D = -55/55 = -1

Q8. Solve by Matrix Method: x+y+z=3, 2x-y+z=2, x-2y+3z=2

Matrix form AX = B:
A = [1   1  1]    X = [x]    B = [3]
    [2  -1  1]        [y]        [2]
    [1  -2  3]        [z]        [2]
det(A) = 1(-3+2) - 1(6-1) + 1(-4+1) = -1 - 5 - 3 = -9 ... wait, let me recalculate:
= 1((-1)(3)-(1)(-2)) - 1((2)(3)-(1)(1)) + 1((2)(-2)-(-1)(1))
= 1(-3+2) - 1(6-1) + 1(-4+1)
= 1(-1) - 1(5) + 1(-3) = -9
Using Cramer's rule:
Dx: Replace col 1 with B:
|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|
x = -9/-9 = 1
Dy: Replace col 2 with B:
|1  3  1|
|2  2  1| = 1(6-2)-3(6-1)+1(-4-2) = 4-15-6 = -17
|1  2  3|
Hmm, let me redo: = 1(2Γ—3-1Γ—2)-3(2Γ—3-1Γ—1)+1(2Γ—2-2Γ—1) = 1(4) - 3(5) + 1(2) = 4-15+2 = -9
y = -9/-9 = 1
Dz: Replace col 3 with B:
|1  1  3|
|2 -1  2| = 1(-2+4)-1(4-2)+3(-4+1) = 2-2-9 = -9
|1 -2  2|
z = -9/-9 = 1
Answer: x = 1, y = 1, z = 1

Q9. Resolve (x-5)/[(x-3)(x-4)] into Partial Fractions

Let: (x-5)/[(x-3)(x-4)] = A/(x-3) + B/(x-4)
Multiply both sides by (x-3)(x-4):
x - 5 = A(x-4) + B(x-3)
Put x = 3: 3-5 = A(3-4) β†’ -2 = -A β†’ A = 2
Put x = 4: 4-5 = B(4-3) β†’ -1 = B β†’ B = -1
Answer: (x-5)/[(x-3)(x-4)] = 2/(x-3) - 1/(x-4)

CHAPTER 2: ANALYTICAL GEOMETRY


Q10. Define Quadrant.

Answer: The coordinate axes divide the plane into 4 regions called Quadrants:
QuadrantxyExample
I (First)++(3, 5)
II (Second)-+(-2, 4)
III (Third)--(-1, -3)
IV (Fourth)+-(4, -2)

Q11. Define Distance Formula.

Answer: The distance between two points P(x₁, y₁) and Q(xβ‚‚, yβ‚‚) is:
d = √[(xβ‚‚-x₁)Β² + (yβ‚‚-y₁)Β²]
This is derived from the Pythagorean theorem.

Q12. Find the Distance between (5, 4) and (-5, 6).

Solution:
d = √[(-5-5)² + (6-4)²]
= √[(-10)² + (2)²]
= √[100 + 4]
= √104
= 2√26 β‰ˆ 10.2 units

Q13. Show the four points (0,5), (-2,-2), (5,0) and (7,7) on a graph.

Answer: Plot each point on the coordinate plane:
  • (0,5) - on Y-axis, 5 units up
  • (-2,-2) - 2nd quadrant (negative both)... wait, (-2,-2) is in 3rd quadrant
  • (5,0) - on X-axis, 5 units right
  • (7,7) - 1st quadrant
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)
These 4 points form a quadrilateral when joined.

Q14. Find Area of Triangle with vertices (0,0), (1,0), (1,1).

Formula: Area = (1/2)|x₁(yβ‚‚-y₃) + xβ‚‚(y₃-y₁) + x₃(y₁-yβ‚‚)|
= (1/2)|0(0-1) + 1(1-0) + 1(0-0)|
= (1/2)|0 + 1 + 0|
= (1/2)|1|
= 1/2 square unit

Q15. Find the equation of a straight line passing through (-4, -2) with slope -8.

Using Point-Slope Form: y - y₁ = m(x - x₁)
y - (-2) = -8(x - (-4))
y + 2 = -8(x + 4)
y + 2 = -8x - 32
y = -8x - 34 or 8x + y + 34 = 0

CHAPTER 3: TRIGONOMETRY


Q16. Prove: cos 52Β° = cos 68Β° + cos 172Β° = 0

Proof: cos 68Β° + cos 172Β°
Using sum-to-product: cos A + cos B = 2cos[(A+B)/2]cos[(A-B)/2]
= 2cos[(68+172)/2]cos[(172-68)/2]
= 2cos(120Β°)cos(52Β°)
= 2(-1/2)cos(52Β°)
= -cos(52Β°)
So: cos 68Β° + cos 172Β° = -cos 52Β°
Therefore: cos 52Β° + cos 68Β° + cos 172Β° = cos 52Β° - cos 52Β° = 0 βœ“

Q17. If tan A = √3 and tan B = 2-√3, find tan(A-B).

Formula: tan(A-B) = (tan A - tan B)/(1 + tan A Β· tan B)
tan A - tan B = √3 - (2-√3) = √3 - 2 + √3 = 2√3 - 2
tan A · tan B = √3(2-√3) = 2√3 - 3
1 + tan A · tan B = 1 + 2√3 - 3 = 2√3 - 2
tan(A-B) = (2√3-2)/(2√3-2) = 1
Therefore: A - B = 45Β°

CHAPTER 4: DIFFERENTIAL CALCULUS


Q18. Differentiate y = log(x) Β· tan(x) with respect to x.

Using Product Rule: d/dx[uΒ·v] = uΒ·v' + vΒ·u'
Let u = log x β†’ du/dx = 1/x Let v = tan x β†’ dv/dx = secΒ²x
dy/dx = log(x) Β· secΒ²x + tan(x) Β· (1/x)
dy/dx = log(x)Β·secΒ²x + tan(x)/x

Q19. If y = x⁸ - 12x⁡ + 5x³ - 12, find d²y/dx².

First derivative: dy/dx = 8x⁷ - 60x⁴ + 15x²
Second derivative: d²y/dx² = 56x⁢ - 240x³ + 30x

Q20. Find dy/dx if y = 3x² + 7x⁷ and y = x⁴ + sin x.

Part (a): y = 3x² + 7x⁷
dy/dx = 6x + 49x⁢
Part (b): y = x⁴ + sin x
dy/dx = 4xΒ³ + cos x

CHAPTER 5: DIFFERENTIAL EQUATIONS


Q21. Add a Note on Differential Equation.

Answer: A Differential Equation is an equation that contains derivatives of a dependent variable with respect to one or more independent variables.
Examples:
  • dy/dx = 2x + 3 (1st order)
  • dΒ²y/dxΒ² + 5(dy/dx) + 6y = 0 (2nd order)
  • 2xydx + (xΒ²+yΒ²)dy = 0
Types:
  • Ordinary DE (ODE): One independent variable
  • Partial DE (PDE): Two or more independent variables

Q22. Define Order and Degree of a Differential Equation with 3 Examples.

Definitions:
  • Order = the order of the highest derivative present
  • Degree = the power of the highest order derivative (after clearing fractions/radicals)
EquationOrderDegree
dy/dx = 5x + 311
(dΒ²y/dxΒ²)Β³ + dy/dx = 023
dΒ³y/dxΒ³ + 2(dy/dx)Β² = x31

Q23. Solve the Differential Equation: 2xyΒ·dx + (xΒ² + yΒ²)dy = 0

Rearranging: 2xyΒ·dx = -(xΒ²+yΒ²)dy
dx/dy = -(xΒ²+yΒ²)/(2xy)
This is a homogeneous equation. Let x = vy β†’ dx/dy = v + yΒ·dv/dy
v + yΒ·dv/dy = -(vΒ²yΒ²+yΒ²)/(2vyΒ²) = -(vΒ²+1)/(2v)
yΒ·dv/dy = -(vΒ²+1)/(2v) - v = -(vΒ²+1+2vΒ²)/(2v) = -(3vΒ²+1)/(2v)
Separating variables: 2vΒ·dv/(3vΒ²+1) = -dy/y
Integrating both sides: (1/3)ln(3vΒ²+1) = -ln y + C
ln(3vΒ²+1) = -3ln y + C
(3vΒ²+1) = k/yΒ³
Substituting back v = x/y: (3xΒ²/yΒ² + 1) = k/yΒ³
3xΒ² + yΒ² = ky ← General Solution

Q24. Solve: 4dΒ²y/dxΒ² + 4dy/dx - 3y = e^(2x)

Auxiliary Equation: 4mΒ² + 4m - 3 = 0
(2m+3)(2m-1) = 0
m = 1/2 or m = -3/2
Complementary Function (C.F.): y_c = C₁e^(x/2) + Cβ‚‚e^(-3x/2)
Particular Integral (P.I.): For e^(2x): P.I. = e^(2x)/f(D) where D→2
= e^(2x)/(4(4)+4(2)-3) = e^(2x)/(16+8-3) = e^(2x)/21
General Solution: y = C₁e^(x/2) + Cβ‚‚e^(-3x/2) + e^(2x)/21

CHAPTER 6: INTEGRAL CALCULUS


Q25. Evaluate ∫(3x² + 2x + 5)dx

= 3xΒ³/3 + 2xΒ²/2 + 5x + C
= xΒ³ + xΒ² + 5x + C

Q26. Evaluate ∫sin(x)dx and ∫cos(x)dx

∫sin(x)dx = -cos(x) + C
∫cos(x)dx = sin(x) + C

Q27. Evaluate ∫e^x dx and ∫(1/x)dx

∫e^x dx = e^x + C
∫(1/x)dx = ln|x| + C

CHAPTER 7: LAPLACE TRANSFORM


Q28. Define Laplace Transform.

Answer: The Laplace Transform of a function f(t) is defined as:
L{f(t)} = F(s) = βˆ«β‚€^∞ e^(-st) f(t) dt
where s is a complex number.

Q29. Standard Laplace Transform Formulas (Must Memorize):

f(t)L{f(t)} = F(s)
11/s
t1/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Β²]

Q30. Find L{3tΒ² + 2e^(3t) + sin 4t}

L{3tΒ²} = 3 Γ— 2!/sΒ³ = 6/sΒ³
L{2e^(3t)} = 2/(s-3)
L{sin 4t} = 4/(sΒ²+16)
Answer: L = 6/sΒ³ + 2/(s-3) + 4/(sΒ²+16)

QUICK REVISION SUMMARY TABLE

ChapterKey Topics to Remember
MatricesOrder, Types, Adj, A⁻¹, Cramer's Rule
Analytical GeometryDistance formula, Area of triangle, Line equation, Quadrants
TrigonometrySum-to-product, tan(A-B) formula
Differential CalculusProduct rule, Chain rule, 2nd derivatives
Differential EquationsOrder, Degree, Homogeneous, 2nd order linear
Integral CalculusStandard integrals, Definite integrals
Laplace TransformDefinition, 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

Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/math-question-bank

Writing File

~/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);
});
Running Command

cd /home/daytona/workspace/math-question-bank && node generate.js 2>&1

Running Command

python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/math-question-bank/Remedial_Math_Question_Bank.docx 2>&1

Running Command

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])"

The file is valid. Here's your download link:

Remedial Math Question Bank

Word Document Β· DOCX


What's inside the document:
SectionContent
Title PageCourse info, chapter list table
Chapter 1 - MatricesQ1-Q9: Definitions, Types, Transpose, Operations, Adj & A⁻¹, Cramer's Rule, Matrix Method, Partial Fractions
Chapter 2 - Analytical GeometryQ10-Q15: Quadrants, Distance Formula, Area of Triangle, Line Equations, Graph plotting
Chapter 3 - TrigonometryQ16-Q17: cos identity proof, tan(A-B) formula
Chapter 4 - Differential CalculusQ18-Q20: Product rule, 2nd derivatives, dy/dx problems
Chapter 5 - Differential EquationsQ21-Q24: Definitions, Order & Degree, Homogeneous DE, 2nd order linear DE
Chapter 6 - Integral CalculusQ25-Q27: Standard integrals with formula table
Chapter 7 - Laplace TransformQ28-Q30: Definition, standard table, solved problems
Quick Revision PageSummary table of all 7 chapters
The document has:
  • Color-coded headings (blue theme)
  • Shaded boxes for all solutions (easy to read)
  • Tables for formulas and definitions
  • Page numbers in the footer
  • Print-ready A4 formatting with proper margins

Create a quick reference formula card (one-page PDF cheat sheet)

Reading File
Writing File

~/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)
Running Command

cd /home/daytona/workspace/math-question-bank && python3 make_cheatsheet.py 2>&1

Running Command

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') "

Your cheat sheet is ready - exactly 1 page, 12 KB, print-ready A4.

Math Formula Cheatsheet

PDF Document Β· PDF


What's on the cheat sheet (3-column layout):
Column 1Column 2Column 3
Matrices & Determinants - Order, det, Adj, A⁻¹, Cramer's Rule, Partial FractionsDifferential Calculus - All 10 standard derivatives, Product/Quotient/Chain rulesDifferential Equations - Order/Degree, Separable, Linear 1st order, 2nd order (CF+PI)
Trigonometry - Pythagorean identities, Addition formulas, Sum-to-product, Double angleIntegral Calculus - 10 standard integrals (power, trig, exp, log, inverse trig)Laplace Transform - Definition + 11 standard formulas including shift theorem
Full-width strip at bottom:
  • Analytical Geometry - Distance, Midpoint, Area of triangle, Slope, Line equations, All 4 quadrants
Design features:
  • Each chapter has its own distinct color (blue, teal, green, orange, purple, brown)
  • Alternating row shading for easy reading
  • Dark blue border around the entire page
  • University name in the footer

THIS FILE IS NOT OPENING

Running Command

python3 -c "import reportlab; print(reportlab.Version)"

Running Command

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]) "

Running Command

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

Writing File

~/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 &mdash; FORMULA CHEAT SHEET</h1>
    <p>DPH-106 &nbsp;|&nbsp; Pharm. D Year 1 &nbsp;|&nbsp; 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 &amp; Determinants</div>
        <table class="ftable">
          <tr><td class="lbl">Order</td><td>Rows &times; Columns</td></tr>
          <tr><td class="lbl">A + B</td><td>Add corresponding elements</td></tr>
          <tr><td class="lbl">k &middot; A</td><td>Multiply every element by k</td></tr>
          <tr><td class="lbl">det[a,b;c,d]</td><td>= ad &minus; bc</td></tr>
          <tr><td class="lbl">A<sup>&minus;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, &nbsp;y = D<sub>y</sub>/D, &nbsp;z = D<sub>z</sub>/D</td></tr>
          <tr><td class="lbl">Partial Frac</td><td>A/(x&minus;a) + B/(x&minus;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&sup2;x + cos&sup2;x</td><td>= 1</td></tr>
          <tr><td class="lbl">1 + tan&sup2;x</td><td>= sec&sup2;x</td></tr>
          <tr><td class="lbl">sin(A&plusmn;B)</td><td>= sinA cosB &plusmn; cosA sinB</td></tr>
          <tr><td class="lbl">cos(A&plusmn;B)</td><td>= cosA cosB &mp; sinA sinB</td></tr>
          <tr><td class="lbl">tan(A&minus;B)</td><td>= (tanA&minus;tanB)/(1+tanA&middot;tanB)</td></tr>
          <tr><td class="lbl">cosA + cosB</td><td>= 2cos[(A+B)/2]cos[(A&minus;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&sup2;A &minus; sin&sup2;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 &middot; x<sup>n&minus;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> &middot; 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>= &minus;sin x</td></tr>
          <tr><td class="lbl">d/dx [tan x]</td><td>= sec&sup2; x</td></tr>
          <tr><td class="lbl">d/dx [cot x]</td><td>= &minus;cosec&sup2; x</td></tr>
          <tr><td class="lbl">d/dx [sec x]</td><td>= sec x &middot; tan x</td></tr>
          <tr><td class="lbl">d/dx [cosec x]</td><td>= &minus;cosec x &middot; cot x</td></tr>
          <tr><td class="lbl">Product Rule</td><td>d/dx[uv] = u&middot;v&prime; + v&middot;u&prime;</td></tr>
          <tr><td class="lbl">Quotient Rule</td><td>(v&middot;u&prime; &minus; u&middot;v&prime;) / v&sup2;</td></tr>
          <tr><td class="lbl">Chain Rule</td><td>dy/dx = (dy/du)&middot;(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">&int; x<sup>n</sup> dx</td><td>= x<sup>n+1</sup>/(n+1) + C</td></tr>
          <tr><td class="lbl">&int; 1/x dx</td><td>= ln|x| + C</td></tr>
          <tr><td class="lbl">&int; e<sup>x</sup> dx</td><td>= e<sup>x</sup> + C</td></tr>
          <tr><td class="lbl">&int; a<sup>x</sup> dx</td><td>= a<sup>x</sup>/ln(a) + C</td></tr>
          <tr><td class="lbl">&int; sin x dx</td><td>= &minus;cos x + C</td></tr>
          <tr><td class="lbl">&int; cos x dx</td><td>= sin x + C</td></tr>
          <tr><td class="lbl">&int; sec&sup2;x dx</td><td>= tan x + C</td></tr>
          <tr><td class="lbl">&int; cosec&sup2;x dx</td><td>= &minus;cot x + C</td></tr>
          <tr><td class="lbl">&int; 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 &rarr; integrate both</td></tr>
          <tr><td class="lbl">Homogeneous</td><td>Sub y=vx, dy/dx = v + x&middot;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>&int;P dx</sup></td></tr>
          <tr><td class="lbl">Solution</td><td>y &middot; IF = &int;(Q &middot; IF)dx + C</td></tr>
          <tr><td class="lbl">2nd order AE</td><td>am&sup2; + 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&plusmn;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) &nbsp; [f(a)&ne;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)} = &int;<sub>0</sub><sup>&infin;</sup> e<sup>&minus;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&minus;a)</td></tr>
          <tr><td class="lbl">L{sin(at)}</td><td>= a/(s&sup2;+a&sup2;)</td></tr>
          <tr><td class="lbl">L{cos(at)}</td><td>= s/(s&sup2;+a&sup2;)</td></tr>
          <tr><td class="lbl">L{e<sup>at</sup>sin(bt)}</td><td>= b/[(s&minus;a)&sup2;+b&sup2;]</td></tr>
          <tr><td class="lbl">L{e<sup>at</sup>cos(bt)}</td><td>= (s&minus;a)/[(s&minus;a)&sup2;+b&sup2;]</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&minus;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 = &radic;[(x<sub>2</sub>&minus;x<sub>1</sub>)&sup2;+(y<sub>2</sub>&minus;y<sub>1</sub>)&sup2;]</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 &triangle;</td><td>&frac12;|x<sub>1</sub>(y<sub>2</sub>&minus;y<sub>3</sub>)+x<sub>2</sub>(y<sub>3</sub>&minus;y<sub>1</sub>)+x<sub>3</sub>(y<sub>1</sub>&minus;y<sub>2</sub>)|</td></tr>
      </table>
      <table class="ftable s-mid">
        <tr><td class="lbl">Slope m</td><td>= (y<sub>2</sub>&minus;y<sub>1</sub>) / (x<sub>2</sub>&minus;x<sub>1</sub>)</td></tr>
        <tr><td class="lbl">Point-Slope</td><td>y &minus; y<sub>1</sub> = m(x &minus; 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 &gt; 0, y &gt; 0 &nbsp; (+,+)</td></tr>
        <tr><td class="lbl">Quadrant II</td><td>x &lt; 0, y &gt; 0 &nbsp; (&minus;,+)</td></tr>
        <tr><td class="lbl">Quadrant III</td><td>x &lt; 0, y &lt; 0 &nbsp; (&minus;,&minus;)</td></tr>
        <tr><td class="lbl">Quadrant IV</td><td>x &gt; 0, y &lt; 0 &nbsp; (+,&minus;)</td></tr>
      </table>
    </div>
  </div>

  <div class="footer">Remedial Mathematics DPH-106 &nbsp;|&nbsp; Quick Reference Cheat Sheet &nbsp;|&nbsp; Om Sterling Global University &nbsp;|&nbsp; Open in any browser &rarr; Ctrl+P to print</div>

</div>
</body>
</html>
Running Command

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

The v2 PDF (42KB, generated fresh without compression issues) and the HTML are both ready. Here are 3 download options - one of them will definitely work for you:

Download Options:

Option 1 - PDF (v2, 42KB - most compatible):

Math Formula Cheatsheet v2

PDF Document Β· PDF

Option 2 - HTML (opens in ANY browser, print with Ctrl+P):

Math Formula Cheatsheet

HTML File Β· HTML

Option 3 - Original PDF:

Math Formula Cheatsheet

PDF Document Β· PDF


How to use the HTML file for printing:

  1. Download and open Math_Formula_Cheatsheet.html in Chrome or Firefox
  2. Press Ctrl+P (or Cmd+P on Mac)
  3. Set paper size to A4, margins to Minimum
  4. Enable Background graphics in print settings
  5. Click Print - it will come out as a perfect one-page color sheet
The HTML version is actually the most reliable - it works on any phone, tablet or computer without needing any PDF reader app.
This is a shared conversation. Sign in to Orris to start your own chat.