On this page
A linear expression over a quadratic, like (3x + 5)/(x² + 4x + 13), comes up again and again in Class 12 integration and JEE practice. It looks like a new problem every time, but it isn't. The derivative of the denominator is also linear, so you can write the numerator as a multiple of that derivative plus a leftover constant. The multiple gives a logarithm and the constant gives an inverse tangent.
How do you integrate (px + q)/(ax² + bx + c)?
Call the denominator Q = ax² + bx + c. Then work through these five steps.
Differentiate the denominator: Q′ = 2ax + b.
Write px + q = A(2ax + b) + B.
Compare coefficients. The x terms give p = 2aA, so A = p/(2a). The constants give q = Ab + B, so B = q − bp/(2a).
Split the integral: A ∫ Q′/Q dx + B ∫ dx/Q. The first piece is A ln|Q|, because the numerator is exactly the derivative of the denominator.
For B ∫ dx/Q, complete the square in Q and use a standard form.
The open textbook APEX Calculus, section 6.5 shows this split inside a longer partial-fractions problem (Example 6.5.9). It reaches ∫(2x + 6)/(x² + 6x + 11) dx − ∫7/(x² + 6x + 11) dx and gets ln|x² + 6x + 11| − (7/√2) tan⁻¹((x + 3)/√2) for those two pieces. Notice that 2x + 6 is exactly the derivative of x² + 6x + 11, which is why the first piece is a clean log.
Worked example: what is ∫(3x + 5)/(x² + 4x + 13) dx?
Here Q = x² + 4x + 13 and Q′ = 2x + 4.
Write 3x + 5 = A(2x + 4) + B. The x terms give 2A = 3, so A = 3/2. The constants give 4A + B = 5, so B = 5 − 6 = −1.
The integral becomes (3/2) ∫(2x + 4)/(x² + 4x + 13) dx − ∫dx/(x² + 4x + 13).
The log part is (3/2) ln(x² + 4x + 13). You can drop the modulus here: the discriminant is 16 − 52 = −36, so Q is never zero and always positive.
For the arctan part, complete the square: x² + 4x + 13 = (x + 2)² + 9 = (x + 2)² + 3². Using ∫du/(u² + k²) = (1/k) tan⁻¹(u/k), that piece is (1/3) tan⁻¹((x + 2)/3).
So the answer is (3/2) ln(x² + 4x + 13) − (1/3) tan⁻¹((x + 2)/3) + C.
It works on answers from a book or a chatbot too; our guide on checking an AI's integral by differentiating it walks through it.
What if the quadratic has real roots?
The A part is always a log. What the B part turns into depends on the discriminant b² − 4ac.
Negative: Q is a sum of squares after completing the square, and B ∫dx/Q is an arctan, as in the example above.
Zero: Q = a(x − h)², and B ∫dx/Q is −B/(a(x − h)).
Positive: Q is a difference of squares, and ∫du/(u² − k²) = (1/(2k)) ln|(u − k)/(u + k)|. You can also factor Q and use partial fractions for integration instead.
If you want the full set of standard forms for the B part, including the square-root versions, see our guide to integrals with quadratic denominators.
Which mistakes cost marks on this type?
Writing A = p instead of A = p/(2a).
Completing the square without first taking a out. With 2x² + 4x + 5, factor the 2 out first.
Losing the sign of B. In the example, B = −1 carries through to the arctan term.
Dropping a modulus that is needed. Check the discriminant first.
A three-question drill to make it automatic
Do these three, one for each discriminant case. First write down only A and B for all three. Then finish each one, and differentiate to check.
∫(2x + 3)/(x² + 2x + 5) dx
∫(x + 1)/(x² − 4x + 4) dx
∫(x + 3)/(x² − 1) dx
Answers: (1) A = 1, B = 1, giving ln(x² + 2x + 5) + (1/2) tan⁻¹((x + 1)/2) + C. (2) A = 1/2, B = 3, giving ln|x − 2| − 3/(x − 2) + C. (3) A = 1/2, B = 3, giving (1/2) ln|x² − 1| + (3/2) ln|(x − 1)/(x + 1)| + C, which simplifies to 2 ln|x − 1| − ln|x + 1| + C.
If you got A and B wrong, the method isn't the problem. The Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you can compare each line with your own working. If completing the square is the shaky step, go back to it in the Fermi Concept Library.



