A standard definite integral problem, not tied to a specific exam paper.
Problem
Evaluate:
$$I = \int_0^{\pi/4}\log(1+\tan x)\,dx$$
Key insight. Substituting $x\to\dfrac{\pi}4-x$ turns $1+\tan x$ into $\dfrac2{1+\tan x}$ — a clean reciprocal-style relationship that, once the logarithm splits it into a sum, lets the original integral $I$ appear on both sides of an equation and be solved for algebraically.
Watch this explained step by step → · More on the Shiwam’s Classes channel
Approach
Apply King’s property, $\displaystyle\int_0^a g(x)\,dx=\int_0^a g(a-x)\,dx$, with $a=\dfrac{\pi}4$. Simplify $\tan\left(\dfrac{\pi}4-x\right)$ using the tangent subtraction formula, which reveals that $1+\tan\left(\dfrac{\pi}4-x\right)$ simplifies to $\dfrac2{1+\tan x}$. Substituting this back gives a second expression for $I$ in terms of the same integral, and adding the two expressions together isolates $I$.
Solution
Step 1 — Apply King’s property
$$I = \int_0^{\pi/4}\log(1+\tan x)\,dx = \int_0^{\pi/4}\log\left(1+\tan\left(\frac{\pi}4-x\right)\right)dx$$
Step 2 — Simplify tan(π/4 − x)
$$\tan\left(\frac{\pi}4-x\right) = \frac{1-\tan x}{1+\tan x}$$
Step 3 — Simplify 1 + tan(π/4 − x)
$$1+\tan\left(\frac{\pi}4-x\right) = 1+\frac{1-\tan x}{1+\tan x} = \frac{(1+\tan x)+(1-\tan x)}{1+\tan x} = \frac2{1+\tan x}$$
Step 4 — Substitute back into I
$$I = \int_0^{\pi/4}\log\left(\frac2{1+\tan x}\right)dx = \int_0^{\pi/4}\left[\log2-\log(1+\tan x)\right]dx$$
$$I = \int_0^{\pi/4}\log2\,dx – \int_0^{\pi/4}\log(1+\tan x)\,dx$$
Step 5 — Recognise the second integral as I itself
$$I = \frac{\pi}4\log2 – I$$
Step 6 — Solve for I
$$2I = \frac{\pi}4\log2 \implies I = \frac{\pi}8\log2$$
Answer
$$\frac{\pi}8\log2$$
Common mistakes
- Misapplying the tangent subtraction formula. $\tan\left(\dfrac{\pi}4-x\right)=\dfrac{1-\tan x}{1+\tan x}$ — mixing up the numerator and denominator, or the sign, breaks the clean simplification in Step 3 that the whole trick depends on.
- Forgetting to split log(2/(1+tan x)) using the quotient rule for logarithms. Without writing it as $\log2-\log(1+\tan x)$, the integral $I$ never reappears explicitly on the right-hand side, and the equation can’t be solved for $I$.
- Losing track of which integral is I after the substitution. By the end of Step 4, both the original $I$ and the newly-formed integral are literally the same expression, $\int_0^{\pi/4}\log(1+\tan x)\,dx$ — it’s worth pausing to confirm this explicitly rather than treating it as a “different” unknown.
Practise next
- Using the result above, evaluate $\displaystyle\int_0^{\pi/4}\log(2+2\tan x)\,dx$.
Show answer
$\dfrac{3\pi}8\log2$. Since $\log(2+2\tan x)=\log\!\big(2(1+\tan x)\big)=\log2+\log(1+\tan x)$, the integral splits into two known pieces.
$\displaystyle\int_0^{\pi/4}\log2\,dx=\frac{\pi}4\log2$, and $\displaystyle\int_0^{\pi/4}\log(1+\tan x)\,dx=\frac{\pi}8\log2$ from the main result.
Adding: $\dfrac{\pi}4\log2+\dfrac{\pi}8\log2=\dfrac{2\pi}8\log2+\dfrac{\pi}8\log2=\dfrac{3\pi}8\log2$.

Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.