Why the Numerator and Denominator Fit Together
A rational term with a linear numerator over an irreducible quadratic has a useful structure: the derivative of the denominator is itself linear. Part of the numerator can therefore be integrated by the logarithm rule. What remains is a constant divided by the quadratic, which leads to an arctangent after completing the square.
This method is useful when integrating terms such as \((mx+n)/(ax^2+bx+c)\), where the quadratic has no real roots. It produces a compact formula, but the coefficient of the arctangent depends on the quadratic’s scale. Keeping track of that scale is essential.
For such a quadratic, \(4ac-b^2>0\). Its denominator never vanishes on the real line, so the rational function is defined for every real \(x\). We will use the positive number \(S=\sqrt{4ac-b^2}\) to keep the formula readable.
Separate the Derivative Part
Let \(m,n,a,b,c\) be real constants, with \(a\ne 0\) and \(b^2-4ac<0\). The denominator and its derivative are
Because \(q'\) is linear, we can express any linear numerator \(mx+n\) as a multiple of \(q'\) plus a constant. Matching the coefficient of \(x\) determines that multiple; subtracting it leaves the constant remainder.
Write \(R=n-\frac{mb}{2a}\) for the remainder. Dividing by \(q(x)\) separates the integrand into two terms: \(\frac{m}{2a}\frac{q'(x)}{q(x)}\) and \(\frac{R}{q(x)}\). The first integrates to a logarithm. To integrate the second, complete the square in the quadratic.
Deriving the General Formula
Set \(S=\sqrt{4ac-b^2}>0\). Completing the square, or expanding the right-hand side, gives
In the remaining integral, substitute \(u=2ax+b\). Then \(du=2a\,dx\). Using the standard antiderivative of \(1/(u^2+S^2)\) yields the following result.
Here \(C\) is an arbitrary constant. Since the quadratic has no real zeros, it has a constant sign. The absolute value in the logarithm makes the formula valid whether that sign is positive or negative.
For clarity, the same result can be written using the remainder \(R=n-\frac{mb}{2a}\): the arctangent coefficient is \(2R/S\). The two forms agree because \(2R=2n-\frac{mb}{a}\).
Write \(mx+n=\frac{m}{2a}q'(x)+R\), where \(R=n-\frac{mb}{2a}\).
Use \(\int q'(x)/q(x)\,dx=\ln|q(x)|+C\), since \(q(x)\ne0\) for every real \(x\).
Use \(q(x)=((2ax+b)^2+S^2)/(4a)\) and \(u=2ax+b\) to obtain the arctangent term.
Why the Formula Works
The argument establishes the formula directly. First, the numerator identity gives
Because \(q\) is nonzero on the real line, the derivative of \(\ln|q(x)|\) is \(q'(x)/q(x)\). For the other term, the completed-square identity and substitution \(u=2ax+b\) give
Multiplying this last result by \(R\) produces the arctangent term \(2R/S\). Together, the two integrated parts give the stated expression. This also explains why both the constant remainder and the positive square root \(S\) matter: the former sets the arctangent’s size, and the latter sets its scale.
Worked Examples
Worked Example: A Positive-Leading Quadratic
Evaluate \(\int \frac{3x+8}{x^2+4x+13}\,dx\). Here \(a=1\), \(b=4\), \(c=13\), \(m=3\), and \(n=8\). The discriminant is \(4^2-4(1)(13)=16-52=-36<0\), so the quadratic is irreducible, and \(S=\sqrt{4(1)(13)-4^2}=\sqrt{36}=6\).
The denominator derivative is \(2x+4\). Split the numerator:
since \(\frac{3}{2}(2x+4)=3x+6\), leaving remainder \(2\). Thus
Since \(x^2+4x+13=(x+2)^2+9>0\), the absolute value may be omitted. Simplifying gives \(\frac{3}{2}\ln(x^2+4x+13)+\frac{2}{3}\arctan((x+2)/3)+C\).
Check: Differentiating the logarithmic term gives \((3x+6)/(x^2+4x+13)\). Differentiating the arctangent term gives \(2/((x+2)^2+9)=2/(x^2+4x+13)\). Their sum is \((3x+8)/(x^2+4x+13)\), as required.
Worked Example: A Leading Coefficient Other Than One
Evaluate \(\int \frac{5x+1}{2x^2-4x+5}\,dx\). In this case \(a=2\), \(b=-4\), \(c=5\), \(m=5\), and \(n=1\). The discriminant is \((-4)^2-4(2)(5)=16-40=-24<0\), and \(S=\sqrt{4(2)(5)-(-4)^2}=\sqrt{24}=2\sqrt{6}\).
The derivative of the denominator is \(4x-4\). The numerator split is
because \(\frac{5}{4}(4x-4)=5x-5\), and adding \(6\) gives \(5x+1\). The integral is therefore
The denominator is positive: \(2x^2-4x+5=2(x-1)^2+3\). Check: The logarithm differentiates to \((5x-5)/(2x^2-4x+5)\). For the arctangent, set \(z=(2x-2)/\sqrt{6}\); then \(z'=2/\sqrt{6}\), so its derivative is \(2/(1+z^2)=12/((2x-2)^2+6)=6/(2x^2-4x+5)\). Adding gives the original numerator \(5x+1\) over the denominator.
Worked Example: A Negative-Leading Quadratic
Evaluate \(\int \frac{2x+7}{-x^2+2x-5}\,dx\). Here \(a=-1\), \(b=2\), \(c=-5\), \(m=2\), and \(n=7\). The discriminant is \(2^2-4(-1)(-5)=4-20=-16<0\), and \(S=\sqrt{4(-1)(-5)-2^2}=\sqrt{16}=4\).
The derivative of the denominator is \(-2x+2\). The numerator splits as
Thus \(m/(2a)=-1\) and the constant remainder is \(9\). The antiderivative is
The quadratic equals \(-((x-1)^2+4)\), so it is negative everywhere. Check: The derivative of the logarithmic term is \(-(-2x+2)/(-x^2+2x-5)=(2x-2)/(-x^2+2x-5)\). The arctangent term differentiates to \(-9/((x-1)^2+4)=9/(-x^2+2x-5)\). Together these are \((2x+7)/(-x^2+2x-5)\), the original integrand.
A Common Scaling Mistake
In the first example, completing the square gives \(x^2+4x+13=(x+2)^2+9\). The correct remainder integral is
A common error is to omit the factor \(1/3\) and write just \(\arctan((x+2)/3)\). That is incorrect: differentiating the proposed expression gives \(3/((x+2)^2+9)\), three times the desired integrand. With the factor \(1/3\), the derivative is \(1/((x+2)^2+9)\). In the full example the remainder is \(2\), so its contribution is \(\frac{2}{3}\arctan((x+2)/3)\), not \(2\arctan((x+2)/3)\).
When to Use This Method
Use this formula when the denominator is a single irreducible real quadratic and the numerator has degree at most one. If the numerator is not visibly a multiple of the denominator’s derivative plus a constant, solve for the two coefficients by matching powers of \(x\). The identity used here makes that split explicit.
The method requires \(a\ne0\) and \(b^2-4ac<0\). If the quadratic has real roots, it is not an irreducible quadratic of this type, and the arctangent formula derived here does not apply in this form. For the stated conditions, \(S\) is real and positive, the denominator has no real zeros, and both terms of the antiderivative are defined throughout the real line.
As a final check on any calculation, differentiate the proposed result and combine its terms over the original denominator. The numerator must return exactly to \(mx+n\); this catches errors in either the derivative-matching coefficient or the arctangent scale.
Check Your Understanding
Use the derivative split and the completed-square form to answer these questions.
- For \(q(x)=3x^2+6x+8\), find \(S=\sqrt{4ac-b^2}\), and state why \(q\) has no real zeros.
- Write \(4x+7\) as a multiple of the derivative of \(x^2-2x+5\) plus a constant.
- In the general formula, what is the constant remainder \(R\) in terms of \(m,n,a,\) and \(b\)?
- Why is the logarithm written as \(\ln|q(x)|\) when the leading coefficient \(a\) may be negative?
- For \(\int dx/((x-1)^2+16)\), what coefficient must multiply \(\arctan((x-1)/4)\)?