On this page
Many students meet ∫(x² + 1)/(x⁴ + 1) dx and reach for partial fractions. That works, because x⁴ + 1 = (x² + √2x + 1)(x² − √2x + 1), the route suggested in this Physics Forums thread on the integral. But it costs a page of algebra. A three-line method does the same job, and it solves a whole family of integrals.
How do you integrate (x² + 1)/(x⁴ + 1)?
Divide the top and bottom by x²: (1 + 1/x²)/(x² + 1/x²).
Rewrite the denominator: x² + 1/x² = (x − 1/x)² + 2.
Substitute t = x − 1/x, so dt = (1 + 1/x²) dx, which is exactly the numerator.
Integrate: ∫dt/(t² + 2) = (1/√2) tan⁻¹(t/√2) + C.
Put t back: (1/√2) tan⁻¹((x² − 1)/(√2x)) + C.
This is the habit from our guide to choosing the right t in integration by substitution: pick t so that dt is already sitting in the numerator.
What about (x² − 1)/(x⁴ + 1) and 1/(x⁴ + 1)?
Flip the sign in the numerator and you flip the sign in t. This time x² + 1/x² = (x + 1/x)² − 2, and t = x + 1/x gives dt = (1 − 1/x²) dx, so:
∫(x² − 1)/(x⁴ + 1) dx = ∫dt/(t² − 2) = (1/(2√2)) ln|(x² − √2x + 1)/(x² + √2x + 1)| + C.
These two results are building blocks. Any numerator px² + q splits as ((p + q)/2)(x² + 1) + ((p − q)/2)(x² − 1). So:
1/(x⁴ + 1) is half of [(x² + 1) − (x² − 1)]/(x⁴ + 1).
x²/(x⁴ + 1) is half of [(x² + 1) + (x² − 1)]/(x⁴ + 1).
Each answer is one arctan and one log. Compare that with the long way in our post on integration by partial fractions.
How does it work for any x⁴ + kx² + 1?
Divided by x², the denominator x⁴ + kx² + 1 becomes x² + k + 1/x², which you can write two ways:
(x − 1/x)² + (k + 2), when the numerator is x² + 1
(x + 1/x)² + (k − 2), when the numerator is x² − 1
The sign of the constant decides the answer: positive gives an arctan, negative gives a log (as in completing the square for quadratic denominators), and zero gives ∫dt/t² = −1/t.
A worked case with k = 1: for (x² − 1)/(x⁴ + x² + 1), t = x + 1/x turns the denominator into t² − 1, and the answer is (1/2) ln|(x² − x + 1)/(x² + x + 1)| + C. That matches this Socratic worked solution. For (x² + 1)/(x⁴ + x² + 1), t = x − 1/x gives t² + 3 and (1/√3) tan⁻¹((x² − 1)/(√3x)) + C.
The edge case k = 2 shows whether you understand the rule: for (x² − 1)/(x² + 1)², the constant is zero and the integral is −1/t = −x/(x² + 1) + C.
How do you integrate √tan x?
It is the same family in disguise. Put tan x = t², so sec²x dx = 2t dt and dx = 2t dt/(1 + t⁴). Then:
∫√tan x dx = ∫2t²/(t⁴ + 1) dt = ∫(t² + 1)/(t⁴ + 1) dt + ∫(t² − 1)/(t⁴ + 1) dt.
Use both building blocks with t = √tan x:
∫√tan x dx = (1/√2) tan⁻¹((tan x − 1)/√(2 tan x)) + (1/(2√2)) ln|(tan x − √(2 tan x) + 1)/(tan x + √(2 tan x) + 1)| + C.
Not every computer algebra system manages this one. In a public computer algebra integration test of ∫√tan x dx, seven of the eight systems listed returned an arctan-plus-log answer, but SymPy left the integral unevaluated.
A common exam variant is ∫(√tan x + √cot x) dx. It becomes ∫2(t² + 1)/(t⁴ + 1) dt, no log appears, and the answer is √2 tan⁻¹((tan x − 1)/√(2 tan x)) + C.
Where do students lose marks with these integrals?
The substitution t = x − 1/x breaks at x = 0, and the antiderivative jumps there, as the diagram shows. Try ∫ from −1 to 1 of (x² + 1)/(x⁴ + 1) dx. F(1) − F(−1) = 0 − 0 = 0, which is impossible for a positive integrand. Split at 0 instead: the integrand is even, so the integral is 2[F(1) − F(0⁺)] = 2[0 + π/(2√2)] = π/√2.
Before you write the final answer, check:
Is the numerator x² ± 1, or can you split it into those?
Does the sign inside t oppose the sign in the numerator?
Is k + 2 or k − 2 positive, negative or zero?
Does a definite integral's interval contain x = 0?
If the arctan and log standard forms are shaky, revise them in the Fermi Concept Library. If you get stuck partway through a problem like this, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.



