Let
I = ∫dθ/(2 + tanθ)
We make the substitution
y = tanθ. Then
dy = sec2θdθ = (1 + y2)dθ and we find that
I = ∫dy/((1 + y2)(2 + y)).
Since
5/((1 + y2)(2 + y)) = 1/(2 + y) - y/(1 + y2) + 2/(1 + y2), we find
that
5I = ∫dy/(y + 2) - ∫ydy/(1 + y2) + ∫2dy/(1 + y2) = ln(2 + y) - (ln(1 + y2))/2 + 2 tan-1y.
Therefore
5I = ln(2 + tanθ)/secθ +2θ = ln(2 cosθ + sinθ) + 2θ and we deduce that
I = (2θ + ln(2 cosθ + sinθ))/5,
hence ∫0xdθ/(2 + tanθ) = (2x + ln(2 cos x + sin x) - ln 2)/5.
Plugging in
x = π/4, we conclude that
∫0π/4dθ/(2 + tanθ) = (π +2 ln(3/√2) - 2 ln 2)/10 = (π + ln(9/8))/10.