Skip to content
M
hscscience Ext 1 · Y12
0/100daily goal
0
0
0 due
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
Module 8 · L15 of 20 ~40 min ⚡ +100 XP available

Completing the Square for Integration

You need to integrate $\dfrac{1}{x^2 + 6x + 13}$. There is no obvious substitution — but if you look closely, the denominator is hiding a perfect form. Completing the square rewrites quadratic expressions like $ax^2 + bx + c$ into $(x+p)^2 + q^2$, instantly revealing the $\sin^{-1}$ or $\tan^{-1}$ form. Master this technique and a whole class of integrals that previously seemed impossible becomes routine.

Today's hook — Can you integrate $\dfrac{1}{x^2+6x+13}$ right now? Jot down what you think the first step should be. After card 05, check whether your instinct was right.
0/5QUESTS
01
Recall — your gut answer first
+5 XP warm-up

Consider $\displaystyle\int \frac{1}{x^2+6x+13}\,dx$. Before looking at the technique — what do you notice about the denominator? Can you see any pattern or form it might match? Write your thoughts below.

auto-saved
02
The two moves
+5 XP to read

Every "complete the square for integration" problem uses two decisions: rewrite the quadratic so it matches a standard form, then identify the correct inverse trig integral.

The two standard forms to target after completing the square are:

$\displaystyle\int \frac{1}{\sqrt{a^2-(x+p)^2}}\,dx = \sin^{-1}\!\left(\frac{x+p}{a}\right)+C$

$\displaystyle\int \frac{1}{a^2+(x+p)^2}\,dx = \frac{1}{a}\tan^{-1}\!\left(\frac{x+p}{a}\right)+C$

Quadratic ax²+bx+c Completed square a(x+p)²+q² sin⁻¹ form √(a²-(x+p)²) or tan⁻¹ form a²+(x+p)² Apply inverse trig formula + C
$ax^2+bx+c \;\longrightarrow\; a\!\left[(x+p)^2+q^2\right]$
Match the denominator
If after completing the square you get a sum $(x+p)^2+q^2$, use $\tan^{-1}$. If you get a difference $q^2-(x+p)^2$ under a square root, use $\sin^{-1}$.
Factor out $a$ first
When $a \neq 1$, always factor out $a$ before completing the square: $ax^2+bx+c = a\left[x^2+\frac{b}{a}x\right]+c$.
Check the sign
A negative leading coefficient (like $-x^2$) means you may need to factor out $-1$ first. Make sure the term inside the square root is positive.
03
What you'll master
Know

Key facts

  • Completing the square: $ax^2+bx+c = a\!\left[(x+\tfrac{b}{2a})^2 + \tfrac{c}{a}-\tfrac{b^2}{4a^2}\right]$
  • $\displaystyle\int \frac{dx}{a^2+(x+p)^2} = \frac{1}{a}\tan^{-1}\!\left(\frac{x+p}{a}\right)+C$
  • $\displaystyle\int \frac{dx}{\sqrt{a^2-(x+p)^2}} = \sin^{-1}\!\left(\frac{x+p}{a}\right)+C$
Understand

Concepts

  • Why completing the square reveals the hidden inverse trig form
  • How the shift $x \to x+p$ represents a horizontal translation of the standard form
  • When to use $\sin^{-1}$ versus $\tan^{-1}$ based on the structure after completing the square
Can do

Skills

  • Complete the square for any monic or non-monic quadratic
  • Integrate expressions with linear terms in the denominator or under a square root
  • Handle the case where the numerator is a linear function (split and integrate each part)
04
Key terms
Completing the squareRewriting $x^2+bx$ as $(x+\frac{b}{2})^2 - \frac{b^2}{4}$ by adding and subtracting $\left(\frac{b}{2}\right)^2$.
Perfect square trinomialAn expression of the form $(x+p)^2 = x^2+2px+p^2$. Completing the square creates this form artificially.
Horizontal shiftReplacing $x$ with $x+p$ shifts the standard inverse trig formula horizontally by $p$ units.
$\tan^{-1}$ formApplies when the denominator is a sum of squares: $(x+p)^2 + a^2$.
$\sin^{-1}$ formApplies when the integrand has $\sqrt{a^2 - (x+p)^2}$ in the denominator.
Axis of symmetryThe line $x = -\frac{b}{2a}$ about which the parabola $y = ax^2+bx+c$ is symmetric. This is also $-p$ after completing the square.
05
The completing-the-square method
core concept

Given a quadratic $x^2 + bx + c$, add and subtract $\left(\dfrac{b}{2}\right)^2$ to create a perfect square:

$$x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 - \frac{b^2}{4} + c$$

This rewrites the quadratic as $(x+p)^2 + q^2$ (or $(x+p)^2 - q^2$ for the $\sin^{-1}$ case). Setting $p = \dfrac{b}{2}$ and $q^2 = c - \dfrac{b^2}{4}$:

$$x^2 + bx + c = (x+p)^2 + q^2$$

Example — the hook integral: $x^2 + 6x + 13$. Here $b = 6$, $c = 13$.

$p = \dfrac{6}{2} = 3$,   $q^2 = 13 - 9 = 4$,   so $x^2+6x+13 = (x+3)^2 + 4$.

Then: $\displaystyle\int \frac{dx}{x^2+6x+13} = \int \frac{dx}{(x+3)^2+4} = \frac{1}{2}\tan^{-1}\!\left(\frac{x+3}{2}\right)+C$.

Why does this work? The formula $\int \frac{dx}{a^2+u^2} = \frac{1}{a}\tan^{-1}\!\left(\frac{u}{a}\right)+C$ (where $a$ is a constant) requires a shifted variable $u = x+p$. Since $du = dx$, completing the square perfectly sets up this substitution without any extra chain-rule factor.

Given a quadratic $x^2 + bx + c$, add and subtract $\left(\dfrac{b}{2}\right)^2$ to create a perfect square:

Pause — copy the completing-the-square formula: $x^2+bx+c=\left(x+\frac{b}{2}\right)^2+\left(c-\frac{b^2}{4}\right)$ with a worked numerical example into your book.

Quick check: Completing the square on $x^2 + 4x + 7$ gives which of the following?

06
Integrating after completing the square — $\tan^{-1}$ form
core concept

We just saw the completing-the-square method: $x^2+bx+c=\left(x+\frac{b}{2}\right)^2+\left(c-\frac{b^2}{4}\right)=(x+p)^2+a^2$ where $p=b/2$ and $a^2=c-b^2/4$. That raises a question: once you have $(x+p)^2+a^2$ in the denominator, which specific formula integrates it, and is a substitution needed? This card answers it → substitute $u=x+p$, $du=dx$; then $\int\frac{du}{u^2+a^2}=\frac{1}{a}\tan^{-1}(u/a)+C$.

Once you have $(x+p)^2 + a^2$ in the denominator, apply:

$$\int \frac{1}{a^2+(x+p)^2}\,dx = \frac{1}{a}\tan^{-1}\!\left(\frac{x+p}{a}\right)+C$$

Remember: $a$ is the positive square root of the constant term, not the full constant term itself. For $(x+p)^2 + 9$, we have $a^2 = 9$ so $a = 3$.

Non-monic example: Integrate $\dfrac{1}{2x^2+8x+18}$.

Factor out 2: $\dfrac{1}{2(x^2+4x+9)}$.   Complete the square: $x^2+4x+9 = (x+2)^2+5$.

$\displaystyle\int \frac{dx}{2x^2+8x+18} = \frac{1}{2}\int \frac{dx}{(x+2)^2+5} = \frac{1}{2\sqrt{5}}\tan^{-1}\!\left(\frac{x+2}{\sqrt{5}}\right)+C$.

Common slip. Students write $\frac{1}{q}\tan^{-1}(\ldots)$ where $q^2$ is the constant, rather than $\frac{1}{\sqrt{q^2}} = \frac{1}{a}$. Always extract $a = \sqrt{q^2}$ explicitly.

Once you have $(x+p)^2 + a^2$ in the denominator, apply:

Pause — copy the integration step after completing the square: substitute $u=x+p$ to get $\int\frac{du}{u^2+a^2}=\frac{1}{a}\tan^{-1}(u/a)+C$ into your book.

Did you get this? True or false: $\displaystyle\int \frac{dx}{(x+3)^2+16} = \frac{1}{4}\tan^{-1}\!\left(\frac{x+3}{4}\right)+C$.

PROBLEM 1 · COMPLETE THE SQUARE (MONIC)

Find $\displaystyle\int \frac{1}{x^2-4x+13}\,dx$.

1
Complete the square: $x^2-4x+13 = (x-2)^2 + 9$
$p = -2$, $q^2 = 13-4 = 9$, so $a = 3$. Check: $(x-2)^2+9 = x^2-4x+4+9 = x^2-4x+13$ ✓
PROBLEM 2 · SIN⁻¹ FORM

Find $\displaystyle\int \frac{1}{\sqrt{8+2x-x^2}}\,dx$.

1
Rewrite: $8+2x-x^2 = -(x^2-2x-8) = -\!\left[(x-1)^2-9\right] = 9-(x-1)^2$
Factor out $-1$, complete the square: $x^2-2x = (x-1)^2-1$, so $x^2-2x-8 = (x-1)^2-9$. Negate to get $9-(x-1)^2$.
PROBLEM 3 · LINEAR NUMERATOR

Find $\displaystyle\int \frac{2x+1}{x^2+2x+5}\,dx$.

1
Split the numerator: $2x+1 = (2x+2) - 1$. Note that $\frac{d}{dx}(x^2+2x+5) = 2x+2$.
Recognise that $2x+2$ is the derivative of the denominator. This allows the first part to integrate as a logarithm.

Fill the gap: Completing the square on $x^2 - 6x + 14$ gives $(x-3)^2 +$ .

Trap 01
Forgetting to include the $\frac{1}{a}$ factor
The formula is $\frac{1}{a}\tan^{-1}\!\frac{u}{a}+C$, not $\tan^{-1}\!\frac{u}{a}+C$. Students omit the $\frac{1}{a}$ coefficient. Derive it from the chain rule: $\frac{d}{du}\tan^{-1}\!\frac{u}{a} = \frac{1/a}{1+(u/a)^2} = \frac{a}{a^2+u^2}$, so the integral needs a $\frac{1}{a}$ correction.
Trap 02
Adding the wrong constant when completing the square
To complete $x^2+6x$, add and subtract $\left(\frac{6}{2}\right)^2 = 9$. Students sometimes add $b^2 = 36$ or forget to subtract, giving the wrong constant. Always check: expand $(x+3)^2 = x^2+6x+9$, then add back $c - 9$ from the original.
Trap 03
Applying $\tan^{-1}$ when $\sin^{-1}$ is needed
After CTS, if you have $a^2-(x+p)^2$ (a difference) under a square root, it is $\sin^{-1}$, not $\tan^{-1}$. Key check: is the quadratic negative (with square root) or positive (no square root)? Negative + square root $\Rightarrow \sin^{-1}$; positive denominator $\Rightarrow \tan^{-1}$.

Did you get this? True or false: $\displaystyle\int \frac{dx}{\sqrt{9-(x-1)^2}} = \sin^{-1}\!\left(\dfrac{x-1}{3}\right)+C$.

Work mode · how are you completing this lesson?
1

Complete the square for $x^2 + 10x + 29$. Write it in the form $(x+p)^2 + q^2$.

2

Find $\displaystyle\int \frac{1}{x^2+10x+29}\,dx$.

3

Find $\displaystyle\int \frac{1}{\sqrt{4-(x+1)^2}}\,dx$. (The square is already completed.)

4

Rewrite $10-4x-x^2$ in the form $a^2-(x+p)^2$ by completing the square.

5

Find $\displaystyle\int \frac{3}{2x^2+4x+10}\,dx$. (Hint: factor out 2 from the denominator first.)

Odd one out: Three of these completed-square forms are correct. Which one is NOT?

11
Revisit your thinking

Earlier you tried to identify the first step for $\displaystyle\int \frac{1}{x^2+6x+13}\,dx$.

The answer: complete the square to get $(x+3)^2+4$, then apply $\frac{1}{2}\tan^{-1}\!\frac{x+3}{2}+C$. The key insight is that the integral has no obvious substitution until you expose the hidden $(u^2+a^2)$ structure. Once you see it, the inverse trig formula applies directly.

auto-saved
01
Multiple choice
+5 XP per correct · +25 XP all-correct

Pick your answer, then rate your confidence — that tells the system what to drill next. Each retry pulls a fresh mix from the bank.

02
Short answer
ApplyBand 32 marks

Q1. Complete the square for $x^2 + 8x + 20$, then evaluate $\displaystyle\int \frac{dx}{x^2+8x+20}$. (2 marks)

auto-saved
ApplyBand 43 marks

Q2. Find $\displaystyle\int \frac{dx}{\sqrt{6+4x-x^2}}$. Show all working. (3 marks)

auto-saved
AnalyseBand 53 marks

Q3. Evaluate $\displaystyle\int_0^1 \frac{3x}{x^2+2x+2}\,dx$. (Hint: split the numerator.) (3 marks)

auto-saved
Comprehensive answers (click to reveal)

Activity answers:

1. $x^2+10x+29 = (x+5)^2+4$.

2. $\frac{1}{2}\tan^{-1}\!\frac{x+5}{2}+C$.

3. $\sin^{-1}\!\frac{x+1}{2}+C$ ($a=2$, $u=x+1$).

4. $10-4x-x^2 = -(x^2+4x-10) = -((x+2)^2-14) = 14-(x+2)^2$.

5. $\frac{3}{2}\cdot\frac{1}{2}\tan^{-1}\!\frac{x+1}{2}+C = \frac{3}{4}\tan^{-1}\!\frac{x+1}{2}+C$.


Q1 (2 marks): $x^2+8x+20 = (x+4)^2+4$ [1]. $\int \frac{dx}{(x+4)^2+4} = \frac{1}{2}\tan^{-1}\!\frac{x+4}{2}+C$ [1].

Q2 (3 marks): $6+4x-x^2 = -(x^2-4x-6) = -((x-2)^2-10) = 10-(x-2)^2$ [1]. Matches $\int \frac{du}{\sqrt{a^2-u^2}}$ with $a=\sqrt{10}$, $u=x-2$ [1]. Answer: $\sin^{-1}\!\!\left(\frac{x-2}{\sqrt{10}}\right)+C$ [1].

Q3 (3 marks): $3x = \frac{3}{2}(2x+2)-3$ [1]. $\int_0^1\frac{3x}{x^2+2x+2}dx = \frac{3}{2}\Big[\ln(x^2+2x+2)\Big]_0^1 - 3\int_0^1\frac{dx}{(x+1)^2+1}$ [1]. $= \frac{3}{2}(\ln 5 - \ln 2) - 3\Big[\tan^{-1}(x+1)\Big]_0^1 = \frac{3}{2}\ln\frac{5}{2} - 3\!\left(\frac{\pi}{4}-\frac{\pi}{4}\right)$. Wait — $\tan^{-1}(2)-\tan^{-1}(1) = \tan^{-1}2-\frac{\pi}{4}$. Final: $\frac{3}{2}\ln\frac{5}{2} - 3\!\left(\tan^{-1}2-\frac{\pi}{4}\right)$ [1].

01
Boss battle · The Integration Master
earn bronze · silver · gold

Five timed questions. Beat the boss to bank a tier — gold (90% + speed), silver (75%), or bronze (50%). Replays welcome.

⚔ Enter the arena
02
Science Jump · platform challenge

Climb platforms by answering completing-the-square integration questions. Lighter alternative to the boss.

Mark lesson as complete

Tick when you've finished the practice and review.

🎓
Want help with Completing the Square for Integration?

Work through this topic 1-on-1 with an experienced HSC tutor.

Book a free session →