MatheramaMatherama
← Indefinite Integration
Indefinite Integration·Section 10·7 min read

Trigonometric Integrals: Linear and Quadratic Denominators

In our previous discussion of trigonometric integrals, the trigonometric functions appeared primarily in the numerator as integer powers.

A distinctly different challenge arises when trigonometric expressions appear in the denominator, accompanied by constant terms:

∫dxa+bcos⁡x,∫dxacos⁡x+bsin⁡x+c,∫dxa+bcos⁡2x\int \frac{dx}{a + b\cos x}, \qquad \int \frac{dx}{a\cos x + b\sin x + c}, \qquad \int \frac{dx}{a + b\cos^2 x}

Because addition in denominators cannot be split directly, standard algebra fails. Instead, each family of denominators possesses a tailored algebraic bridge that converts the trigonometric function into a polynomial fraction.

In this tutorial, we establish the five fundamental families of linear and quadratic trigonometric denominators.


Pure Linear Combinations via the Auxiliary Angle§

We begin with the linear combination without a constant term:

∫dxacos⁡x+bsin⁡x\int \frac{dx}{a\cos x + b\sin x}

The Method§

Any linear combination acos⁡x+bsin⁡xa\cos x + b\sin x can be compressed into a single cosine term by introducing an auxiliary angle α\alpha:

acos⁡x+bsin⁡x=r(arcos⁡x+brsin⁡x)=rcos⁡(x−α)a\cos x + b\sin x = r\left(\frac{a}{r}\cos x + \frac{b}{r}\sin x\right) = r\cos(x - \alpha)

where:

r=a2+b2,cos⁡α=aa2+b2,sin⁡α=ba2+b2  ⟹  tan⁡α=bar = \sqrt{a^2 + b^2}, \qquad \cos\alpha = \frac{a}{\sqrt{a^2 + b^2}}, \qquad \sin\alpha = \frac{b}{\sqrt{a^2 + b^2}} \implies \tan\alpha = \frac{b}{a}

Under this transformation, the integral becomes:

∫dxacos⁡x+bsin⁡x=1r∫dxcos⁡(x−α)=1r∫sec⁡(x−α) dx\int \frac{dx}{a\cos x + b\sin x} = \frac{1}{r}\int \frac{dx}{\cos(x - \alpha)} = \frac{1}{r}\int \sec(x - \alpha)\,dx

Using the standard antiderivative of secant:

1rln⁡∣sec⁡(x−α)+tan⁡(x−α)∣+C\frac{1}{r}\ln|\sec(x - \alpha) + \tan(x - \alpha)| + C

Example 1§

Evaluate:

I=∫dxcos⁡x+3sin⁡xI = \int \frac{dx}{\cos x + \sqrt{3}\sin x}

Solution:

Here a=1a = 1 and b=3b = \sqrt{3}.

Compute the amplitude rr:

r=12+(3)2=1+3=2r = \sqrt{1^2 + (\sqrt{3})^2} = \sqrt{1 + 3} = 2

Divide and multiply by 22:

cos⁡x+3sin⁡x=2(12cos⁡x+32sin⁡x)=2(cos⁡xcos⁡π3+sin⁡xsin⁡π3)=2cos⁡(x−π3)\cos x + \sqrt{3}\sin x = 2\left( \frac{1}{2}\cos x + \frac{\sqrt{3}}{2}\sin x \right) = 2\left( \cos x \cos\frac{\pi}{3} + \sin x \sin\frac{\pi}{3} \right) = 2\cos\left(x - \frac{\pi}{3}\right)

Substitute into the integral:

I=12∫dxcos⁡(x−π3)=12∫sec⁡(x−π3)dxI = \frac{1}{2}\int \frac{dx}{\cos\left(x - \frac{\pi}{3}\right)} = \frac{1}{2}\int \sec\left(x - \frac{\pi}{3}\right)dx

Integrating:

I=12ln⁡∣sec⁡(x−π3)+tan⁡(x−π3)∣+CI = \frac{1}{2}\ln\left| \sec\left(x - \frac{\pi}{3}\right) + \tan\left(x - \frac{\pi}{3}\right) \right| + C

Example 2§

Evaluate:

I=∫dx3cos⁡x+4sin⁡xI = \int \frac{dx}{3\cos x + 4\sin x}

Solution:

Here a=3a = 3 and b=4b = 4.

Compute rr:

r=32+42=5r = \sqrt{3^2 + 4^2} = 5

Express the denominator as:

3cos⁡x+4sin⁡x=5cos⁡(x−α)where tan⁡α=433\cos x + 4\sin x = 5\cos(x - \alpha) \qquad \text{where } \tan\alpha = \frac{4}{3}

The integral becomes:

I=15∫sec⁡(x−α) dx=15ln⁡∣sec⁡(x−α)+tan⁡(x−α)∣+CI = \frac{1}{5}\int \sec(x - \alpha)\,dx = \frac{1}{5}\ln|\sec(x - \alpha) + \tan(x - \alpha)| + C

Linear Denominators with Constants: The Weierstrass Substitution§

When the denominator contains a constant term:

∫dxa+bcos⁡x,∫dxa+bsin⁡x,∫dxacos⁡x+bsin⁡x+c\int \frac{dx}{a + b\cos x}, \qquad \int \frac{dx}{a + b\sin x}, \qquad \int \frac{dx}{a\cos x + b\sin x + c}

the auxiliary angle method no longer applies because the constant prevents factoring out rr.

The universal remedy is the Weierstrass Half-Angle Substitution.

The Half-Angle Dictionary§

Let:

t=tan⁡(x2)t = \tan\left(\frac{x}{2}\right)

From trigonometry, we express sin⁡x\sin x and cos⁡x\cos x as rational functions of tt:

cos⁡x=1−tan⁡2(x/2)1+tan⁡2(x/2)=1−t21+t2\cos x = \frac{1 - \tan^2(x/2)}{1 + \tan^2(x/2)} = \frac{1 - t^2}{1 + t^2} sin⁡x=2tan⁡(x/2)1+tan⁡2(x/2)=2t1+t2\sin x = \frac{2\tan(x/2)}{1 + \tan^2(x/2)} = \frac{2t}{1 + t^2}

To find the differential dxdx:

x=2tan⁡−1t  ⟹  dx=2 dt1+t2x = 2\tan^{-1} t \implies dx = \frac{2\,dt}{1 + t^2}

Substituting these three relations into ∫dxacos⁡x+bsin⁡x+c\int \frac{dx}{a\cos x + b\sin x + c}:

∫2 dt1+t2a(1−t21+t2)+b(2t1+t2)+c=∫2 dta(1−t2)+2bt+c(1+t2)\int \frac{\frac{2\,dt}{1 + t^2}}{a\left(\frac{1 - t^2}{1 + t^2}\right) + b\left(\frac{2t}{1 + t^2}\right) + c} = \int \frac{2\,dt}{a(1 - t^2) + 2bt + c(1 + t^2)}

Collecting powers of tt:

∫2 dt(c−a)t2+2bt+(c+a)\int \frac{2\,dt}{(c - a)t^2 + 2bt + (c + a)}

This is an ordinary rational quadratic in tt, which is evaluated by completing the square using our standard quadratic formulas.


Example 3§

Evaluate:

I=∫dx5+4cos⁡xI = \int \frac{dx}{5 + 4\cos x}

Solution:

Substitute t=tan⁡(x/2)t = \tan(x/2):

dx=2 dt1+t2,cos⁡x=1−t21+t2dx = \frac{2\,dt}{1 + t^2}, \qquad \cos x = \frac{1 - t^2}{1 + t^2}

The denominator simplifies to:

5+4(1−t21+t2)=5(1+t2)+4(1−t2)1+t2=t2+91+t25 + 4\left(\frac{1 - t^2}{1 + t^2}\right) = \frac{5(1 + t^2) + 4(1 - t^2)}{1 + t^2} = \frac{t^2 + 9}{1 + t^2}

Substitute into the integral:

I=∫2 dt1+t2t2+91+t2=∫2 dtt2+9=2∫dtt2+32I = \int \frac{\frac{2\,dt}{1 + t^2}}{\frac{t^2 + 9}{1 + t^2}} = \int \frac{2\,dt}{t^2 + 9} = 2\int \frac{dt}{t^2 + 3^2}

Using the standard arctangent formula:

I=2⋅13tan⁡−1(t3)+C=23tan⁡−1(13tan⁡(x2))+CI = 2 \cdot \frac{1}{3}\tan^{-1}\left(\frac{t}{3}\right) + C = \frac{2}{3}\tan^{-1}\left( \frac{1}{3}\tan\left(\frac{x}{2}\right) \right) + C

Example 4§

Evaluate:

I=∫dx3+5cos⁡xI = \int \frac{dx}{3 + 5\cos x}

Solution:

Apply the Weierstrass substitution t=tan⁡(x/2)t = \tan(x/2):

dx=2 dt1+t2,cos⁡x=1−t21+t2dx = \frac{2\,dt}{1 + t^2}, \qquad \cos x = \frac{1 - t^2}{1 + t^2}

Transform the denominator:

3+5(1−t21+t2)=3(1+t2)+5(1−t2)1+t2=8−2t21+t2=2(4−t2)1+t23 + 5\left(\frac{1 - t^2}{1 + t^2}\right) = \frac{3(1 + t^2) + 5(1 - t^2)}{1 + t^2} = \frac{8 - 2t^2}{1 + t^2} = \frac{2(4 - t^2)}{1 + t^2}

Substitute into the integral:

I=∫2 dt1+t22(4−t2)1+t2=∫dt4−t2=∫dt22−t2I = \int \frac{\frac{2\,dt}{1 + t^2}}{\frac{2(4 - t^2)}{1 + t^2}} = \int \frac{dt}{4 - t^2} = \int \frac{dt}{2^2 - t^2}

Using the standard difference-of-squares formula:

I=12(2)ln⁡∣2+t2−t∣+C=14ln⁡∣2+tan⁡(x/2)2−tan⁡(x/2)∣+CI = \frac{1}{2(2)}\ln\left| \frac{2 + t}{2 - t} \right| + C = \frac{1}{4}\ln\left| \frac{2 + \tan(x/2)}{2 - \tan(x/2)} \right| + C

Notice the contrast with Example 3: when the constant term exceeds the cosine coefficient (5>45 > 4), the quadratic denominator has complex roots and yields an arctangent. When the cosine coefficient exceeds the constant (5>35 > 3), the quadratic denominator factors into real roots and yields a logarithm.


Example 5§

Evaluate:

I=∫dx1+sin⁡x+cos⁡xI = \int \frac{dx}{1 + \sin x + \cos x}

Solution:

Substitute t=tan⁡(x/2)t = \tan(x/2):

dx=2 dt1+t2,sin⁡x=2t1+t2,cos⁡x=1−t21+t2dx = \frac{2\,dt}{1 + t^2}, \qquad \sin x = \frac{2t}{1 + t^2}, \qquad \cos x = \frac{1 - t^2}{1 + t^2}

Combine the terms in the denominator:

1+sin⁡x+cos⁡x=(1+t2)+2t+(1−t2)1+t2=2+2t1+t2=2(1+t)1+t21 + \sin x + \cos x = \frac{(1 + t^2) + 2t + (1 - t^2)}{1 + t^2} = \frac{2 + 2t}{1 + t^2} = \frac{2(1 + t)}{1 + t^2}

Substitute into the integral:

I=∫2 dt1+t22(1+t)1+t2=∫dt1+t=ln⁡∣1+t∣+CI = \int \frac{\frac{2\,dt}{1 + t^2}}{\frac{2(1 + t)}{1 + t^2}} = \int \frac{dt}{1 + t} = \ln|1 + t| + C

Returning to xx:

I=ln⁡∣1+tan⁡(x2)∣+CI = \ln\left| 1 + \tan\left(\frac{x}{2}\right) \right| + C

Example 6§

Evaluate:

I=∫dx2+sin⁡xI = \int \frac{dx}{2 + \sin x}

Solution:

Substitute t=tan⁡(x/2)t = \tan(x/2):

2+sin⁡x=2+2t1+t2=2(1+t2)+2t1+t2=2(t2+t+1)1+t22 + \sin x = 2 + \frac{2t}{1 + t^2} = \frac{2(1 + t^2) + 2t}{1 + t^2} = \frac{2(t^2 + t + 1)}{1 + t^2}

Substitute into the integral:

I=∫2 dt1+t22(t2+t+1)1+t2=∫dtt2+t+1I = \int \frac{\frac{2\,dt}{1 + t^2}}{\frac{2(t^2 + t + 1)}{1 + t^2}} = \int \frac{dt}{t^2 + t + 1}

Complete the square in the quadratic denominator:

t2+t+1=(t+12)2+34=(t+12)2+(32)2t^2 + t + 1 = \left(t + \frac{1}{2}\right)^2 + \frac{3}{4} = \left(t + \frac{1}{2}\right)^2 + \left(\frac{\sqrt{3}}{2}\right)^2

Using the arctangent formula:

I=13/2tan⁡−1(t+1/23/2)+C=23tan⁡−1(2t+13)+CI = \frac{1}{\sqrt{3}/2}\tan^{-1}\left( \frac{t + 1/2}{\sqrt{3}/2} \right) + C = \frac{2}{\sqrt{3}}\tan^{-1}\left( \frac{2t + 1}{\sqrt{3}} \right) + C

Substitute t=tan⁡(x/2)t = \tan(x/2):

I=23tan⁡−1(2tan⁡(x/2)+13)+CI = \frac{2}{\sqrt{3}}\tan^{-1}\left( \frac{2\tan(x/2) + 1}{\sqrt{3}} \right) + C

Example 7§

Evaluate:

I=∫dx1+cos⁡xI = \int \frac{dx}{1 + \cos x}

Solution:

While the Weierstrass substitution works, applying half-angle identities directly avoids intermediate rational fractions.

Recall:

1+cos⁡x=2cos⁡2(x2)1 + \cos x = 2\cos^2\left(\frac{x}{2}\right)

Substitute directly into the integral:

I=∫dx2cos⁡2(x/2)=12∫sec⁡2(x2)dx=12⋅tan⁡(x/2)1/2+C=tan⁡(x2)+CI = \int \frac{dx}{2\cos^2(x/2)} = \frac{1}{2}\int \sec^2\left(\frac{x}{2}\right)dx = \frac{1}{2} \cdot \frac{\tan(x/2)}{1/2} + C = \tan\left(\frac{x}{2}\right) + C

Linear Numerator Over Linear Denominator§

When linear trigonometric expressions appear in both the numerator and the denominator:

∫pcos⁡x+qsin⁡xacos⁡x+bsin⁡x dxor∫pcos⁡x+qsin⁡x+racos⁡x+bsin⁡x+c dx\int \frac{p\cos x + q\sin x}{a\cos x + b\sin x}\,dx \qquad \text{or} \qquad \int \frac{p\cos x + q\sin x + r}{a\cos x + b\sin x + c}\,dx

the standard strategy is to express the numerator as a linear combination of the denominator and its derivative.

The Algebraic Decomposition§

Write:

Numerator=A(Denominator)+B(ddx(Denominator))+C\text{Numerator} = A(\text{Denominator}) + B\left(\frac{d}{dx}(\text{Denominator})\right) + C

Equating coefficients of sin⁡x\sin x, cos⁡x\cos x, and the constant term produces a system of linear equations for the constants AA, BB, and CC.

Substituting this decomposition into the integral splits it into three simple parts:

I=A∫1 dx+B∫Denominator′Denominator dx+C∫dxDenominatorI = A \int 1\,dx + B \int \frac{\text{Denominator}'}{\text{Denominator}}\,dx + C \int \frac{dx}{\text{Denominator}} I=Ax+Bln⁡∣Denominator∣+C∫dxDenominatorI = Ax + B\ln|\text{Denominator}| + C \int \frac{dx}{\text{Denominator}}

The third integral is evaluated using the Weierstrass half-angle substitution.


Example 8§

Evaluate:

I=∫3sin⁡x+2cos⁡x2sin⁡x+3cos⁡x dxI = \int \frac{3\sin x + 2\cos x}{2\sin x + 3\cos x}\,dx

Solution:

Set up the decomposition without a constant (since no constant appears in the integrand):

Numerator=A(Denominator)+B(ddx(Denominator))\text{Numerator} = A(\text{Denominator}) + B\left(\frac{d}{dx}(\text{Denominator})\right)

Compute the derivative of the denominator:

ddx(2sin⁡x+3cos⁡x)=2cos⁡x−3sin⁡x\frac{d}{dx}(2\sin x + 3\cos x) = 2\cos x - 3\sin x

Write the identity:

3sin⁡x+2cos⁡x=A(2sin⁡x+3cos⁡x)+B(2cos⁡x−3sin⁡x)3\sin x + 2\cos x = A(2\sin x + 3\cos x) + B(2\cos x - 3\sin x) 3sin⁡x+2cos⁡x=(2A−3B)sin⁡x+(3A+2B)cos⁡x3\sin x + 2\cos x = (2A - 3B)\sin x + (3A + 2B)\cos x

Equate corresponding coefficients:

2A−3B=32A - 3B = 3 3A+2B=23A + 2B = 2

Multiply the first equation by 22 and the second by 33:

4A−6B=64A - 6B = 6 9A+6B=69A + 6B = 6

Adding both equations:

13A=12  ⟹  A=121313A = 12 \implies A = \frac{12}{13}

Substitute into the first equation:

2(1213)−3B=3  ⟹  3B=2413−3=−1513  ⟹  B=−5132\left(\frac{12}{13}\right) - 3B = 3 \implies 3B = \frac{24}{13} - 3 = -\frac{15}{13} \implies B = -\frac{5}{13}

Now split the integral:

I=1213∫1 dx−513∫2cos⁡x−3sin⁡x2sin⁡x+3cos⁡x dxI = \frac{12}{13}\int 1\,dx - \frac{5}{13}\int \frac{2\cos x - 3\sin x}{2\sin x + 3\cos x}\,dx I=1213x−513ln⁡∣2sin⁡x+3cos⁡x∣+CI = \frac{12}{13}x - \frac{5}{13}\ln|2\sin x + 3\cos x| + C

Example 9§

Evaluate:

I=∫2sin⁡x+cos⁡x+3sin⁡x+2cos⁡x+1 dxI = \int \frac{2\sin x + \cos x + 3}{\sin x + 2\cos x + 1}\,dx

Solution:

Set up the decomposition:

Numerator=A(Denominator)+B(ddx(Denominator))+C\text{Numerator} = A(\text{Denominator}) + B\left(\frac{d}{dx}(\text{Denominator})\right) + C 2sin⁡x+cos⁡x+3=A(sin⁡x+2cos⁡x+1)+B(cos⁡x−2sin⁡x)+C2\sin x + \cos x + 3 = A(\sin x + 2\cos x + 1) + B(\cos x - 2\sin x) + C

Collect like terms:

2sin⁡x+cos⁡x+3=(A−2B)sin⁡x+(2A+B)cos⁡x+(A+C)2\sin x + \cos x + 3 = (A - 2B)\sin x + (2A + B)\cos x + (A + C)

Equate coefficients:

A−2B=2A - 2B = 2 2A+B=12A + B = 1 A+C=3A + C = 3

From the second equation, B=1−2AB = 1 - 2A. Substitute into the first:

A−2(1−2A)=2  ⟹  5A−2=2  ⟹  5A=4  ⟹  A=45A - 2(1 - 2A) = 2 \implies 5A - 2 = 2 \implies 5A = 4 \implies A = \frac{4}{5} B=1−2(45)=−35B = 1 - 2\left(\frac{4}{5}\right) = -\frac{3}{5} C=3−45=115C = 3 - \frac{4}{5} = \frac{11}{5}

The integral splits into three parts:

I=45∫1 dx−35∫cos⁡x−2sin⁡xsin⁡x+2cos⁡x+1 dx+115∫dxsin⁡x+2cos⁡x+1I = \frac{4}{5}\int 1\,dx - \frac{3}{5}\int \frac{\cos x - 2\sin x}{\sin x + 2\cos x + 1}\,dx + \frac{11}{5}\int \frac{dx}{\sin x + 2\cos x + 1} I=45x−35ln⁡∣sin⁡x+2cos⁡x+1∣+115I1I = \frac{4}{5}x - \frac{3}{5}\ln|\sin x + 2\cos x + 1| + \frac{11}{5} I_1

To evaluate I1=∫dxsin⁡x+2cos⁡x+1I_1 = \int \frac{dx}{\sin x + 2\cos x + 1}, use the Weierstrass substitution t=tan⁡(x/2)t = \tan(x/2):

sin⁡x+2cos⁡x+1=2t+2(1−t2)+(1+t2)1+t2=3+2t−t21+t2\sin x + 2\cos x + 1 = \frac{2t + 2(1 - t^2) + (1 + t^2)}{1 + t^2} = \frac{3 + 2t - t^2}{1 + t^2} I1=∫2 dt1+t23+2t−t21+t2=∫2 dt3+2t−t2=2∫dt4−(t−1)2=2⋅12(2)ln⁡∣2+(t−1)2−(t−1)∣=12ln⁡∣t+13−t∣I_1 = \int \frac{\frac{2\,dt}{1 + t^2}}{\frac{3 + 2t - t^2}{1 + t^2}} = \int \frac{2\,dt}{3 + 2t - t^2} = 2\int \frac{dt}{4 - (t - 1)^2} = 2 \cdot \frac{1}{2(2)}\ln\left| \frac{2 + (t - 1)}{2 - (t - 1)} \right| = \frac{1}{2}\ln\left| \frac{t + 1}{3 - t} \right|

Substitute t=tan⁡(x/2)t = \tan(x/2) and combine into II:

I=45x−35ln⁡∣sin⁡x+2cos⁡x+1∣+1110ln⁡∣tan⁡(x/2)+13−tan⁡(x/2)∣+CI = \frac{4}{5}x - \frac{3}{5}\ln|\sin x + 2\cos x + 1| + \frac{11}{10}\ln\left| \frac{\tan(x/2) + 1}{3 - \tan(x/2)} \right| + C

Quadratic Denominators with Even Powers§

When the denominator contains even powers of sine and cosine:

∫dxa+bcos⁡2x,∫dxa+bsin⁡2x,∫dxacos⁡2x+bsin⁡xcos⁡x+csin⁡2x,∫dx(asin⁡x+bcos⁡x)2\int \frac{dx}{a + b\cos^2 x}, \qquad \int \frac{dx}{a + b\sin^2 x}, \qquad \int \frac{dx}{a\cos^2 x + b\sin x\cos x + c\sin^2 x}, \qquad \int \frac{dx}{(a\sin x + b\cos x)^2}

the half-angle substitution t=tan⁡(x/2)t = \tan(x/2) would create a fourth-degree polynomial, which is needlessly difficult.

Instead, we use the Tangent Substitution:

t=tan⁡x  ⟹  dt=sec⁡2x dxt = \tan x \implies dt = \sec^2 x\,dx

The Standard Procedure§

  1. Divide both the numerator and the denominator by cos⁡2x\cos^2 x.
  2. The numerator becomes dxcos⁡2x=sec⁡2x dx\frac{dx}{\cos^2 x} = \sec^2 x\,dx, which provides the differential dtdt.
  3. In the denominator, any constant term kk becomes ksec⁡2x=k(1+tan⁡2x)k\sec^2 x = k(1 + \tan^2 x).
  4. The integral reduces to a standard quadratic rational form ∫dtAt2+Bt+C\int \frac{dt}{At^2 + Bt + C}.

Example 10§

Evaluate:

I=∫dx1+3cos⁡2xI = \int \frac{dx}{1 + 3\cos^2 x}

Solution:

Divide numerator and denominator by cos⁡2x\cos^2 x:

I=∫sec⁡2x dxsec⁡2x+3I = \int \frac{\sec^2 x\,dx}{\sec^2 x + 3}

Replace sec⁡2x\sec^2 x in the denominator with 1+tan⁡2x1 + \tan^2 x:

I=∫sec⁡2x dx(1+tan⁡2x)+3=∫sec⁡2x dxtan⁡2x+4I = \int \frac{\sec^2 x\,dx}{(1 + \tan^2 x) + 3} = \int \frac{\sec^2 x\,dx}{\tan^2 x + 4}

Let:

t=tan⁡x  ⟹  dt=sec⁡2x dxt = \tan x \implies dt = \sec^2 x\,dx

Substitute into the integral:

I=∫dtt2+22=12tan⁡−1(t2)+CI = \int \frac{dt}{t^2 + 2^2} = \frac{1}{2}\tan^{-1}\left(\frac{t}{2}\right) + C

Returning to xx:

I=12tan⁡−1(tan⁡x2)+CI = \frac{1}{2}\tan^{-1}\left(\frac{\tan x}{2}\right) + C

Example 11§

Evaluate:

I=∫dx2sin⁡2x+3cos⁡2xI = \int \frac{dx}{2\sin^2 x + 3\cos^2 x}

Solution:

Divide numerator and denominator by cos⁡2x\cos^2 x:

I=∫sec⁡2x dx2tan⁡2x+3=12∫sec⁡2x dxtan⁡2x+32I = \int \frac{\sec^2 x\,dx}{2\tan^2 x + 3} = \frac{1}{2}\int \frac{\sec^2 x\,dx}{\tan^2 x + \frac{3}{2}}

Let t=tan⁡x  ⟹  dt=sec⁡2x dxt = \tan x \implies dt = \sec^2 x\,dx:

I=12∫dtt2+(32)2=12⋅13/2tan⁡−1(t3/2)+CI = \frac{1}{2}\int \frac{dt}{t^2 + \left(\sqrt{\frac{3}{2}}\right)^2} = \frac{1}{2} \cdot \frac{1}{\sqrt{3/2}}\tan^{-1}\left( \frac{t}{\sqrt{3/2}} \right) + C

Simplify the leading coefficient:

12⋅23=123=16\frac{1}{2} \cdot \frac{\sqrt{2}}{\sqrt{3}} = \frac{1}{\sqrt{2}\sqrt{3}} = \frac{1}{\sqrt{6}}

Therefore:

I=16tan⁡−1(2tan⁡x3)+CI = \frac{1}{\sqrt{6}}\tan^{-1}\left( \frac{\sqrt{2}\tan x}{\sqrt{3}} \right) + C

Example 12§

Evaluate:

I=∫dx1+3sin⁡2x+8cos⁡2xI = \int \frac{dx}{1 + 3\sin^2 x + 8\cos^2 x}

Solution:

Divide numerator and denominator by cos⁡2x\cos^2 x:

I=∫sec⁡2x dxsec⁡2x+3tan⁡2x+8I = \int \frac{\sec^2 x\,dx}{\sec^2 x + 3\tan^2 x + 8}

Replace sec⁡2x\sec^2 x with 1+tan⁡2x1 + \tan^2 x:

I=∫sec⁡2x dx(1+tan⁡2x)+3tan⁡2x+8=∫sec⁡2x dx4tan⁡2x+9I = \int \frac{\sec^2 x\,dx}{(1 + \tan^2 x) + 3\tan^2 x + 8} = \int \frac{\sec^2 x\,dx}{4\tan^2 x + 9}

Let t=tan⁡x  ⟹  dt=sec⁡2x dxt = \tan x \implies dt = \sec^2 x\,dx:

I=∫dt4t2+9=14∫dtt2+(32)2I = \int \frac{dt}{4t^2 + 9} = \frac{1}{4}\int \frac{dt}{t^2 + \left(\frac{3}{2}\right)^2}

Using the arctangent formula:

I=14⋅13/2tan⁡−1(t3/2)+C=16tan⁡−1(2tan⁡x3)+CI = \frac{1}{4} \cdot \frac{1}{3/2}\tan^{-1}\left( \frac{t}{3/2} \right) + C = \frac{1}{6}\tan^{-1}\left( \frac{2\tan x}{3} \right) + C

Example 13§

Evaluate:

I=∫dx(2sin⁡x+3cos⁡x)2I = \int \frac{dx}{(2\sin x + 3\cos x)^2}

Solution:

Divide numerator and denominator by cos⁡2x\cos^2 x:

I=∫sec⁡2x dx(2tan⁡x+3)2I = \int \frac{\sec^2 x\,dx}{(2\tan x + 3)^2}

Let:

t=2tan⁡x+3  ⟹  dt=2sec⁡2x dx  ⟹  sec⁡2x dx=dt2t = 2\tan x + 3 \implies dt = 2\sec^2 x\,dx \implies \sec^2 x\,dx = \frac{dt}{2}

Substitute into the integral:

I=∫dt2t2=12∫t−2 dt=−12t+CI = \int \frac{\frac{dt}{2}}{t^2} = \frac{1}{2}\int t^{-2}\,dt = -\frac{1}{2t} + C

Substitute t=2tan⁡x+3t = 2\tan x + 3:

I=−12(2tan⁡x+3)+CI = -\frac{1}{2(2\tan x + 3)} + C

Shifted Angle Differences in Denominators§

A classic class of problems features products of sines or cosines with shifted phase arguments in the denominator:

∫dxsin⁡(x−a)sin⁡(x−b),∫dxcos⁡(x−a)cos⁡(x−b),∫dxsin⁡(x−a)cos⁡(x−b)\int \frac{dx}{\sin(x - a)\sin(x - b)}, \qquad \int \frac{dx}{\cos(x - a)\cos(x - b)}, \qquad \int \frac{dx}{\sin(x - a)\cos(x - b)}

The Algebraic Artifice§

Notice that the difference between the two angles is independent of the variable xx:

(x−a)−(x−b)=b−aor(x−b)−(x−a)=a−b(x - a) - (x - b) = b - a \qquad \text{or} \qquad (x - b) - (x - a) = a - b

We multiply and divide the integral by the constant trigonometric term sin⁡(a−b)\sin(a - b) or cos⁡(a−b)\cos(a - b):

  1. When both factors are of the same kind (both sines or both cosines), multiply and divide by sin⁡(a−b)\sin(a - b).
  2. When the factors are of different kinds (one sine and one cosine), multiply and divide by cos⁡(a−b)\cos(a - b).

Expanding the numerator using addition formulas cancels one factor in each term, converting the integrand into basic tangents and cotangents.


Example 14§

Evaluate:

I=∫dxsin⁡(x−a)sin⁡(x−b)I = \int \frac{dx}{\sin(x - a)\sin(x - b)}

Solution:

Multiply and divide by sin⁡(a−b)\sin(a - b):

I=1sin⁡(a−b)∫sin⁡(a−b)sin⁡(x−a)sin⁡(x−b) dxI = \frac{1}{\sin(a - b)}\int \frac{\sin(a - b)}{\sin(x - a)\sin(x - b)}\,dx

Rewrite a−ba - b as (x−b)−(x−a)(x - b) - (x - a):

sin⁡(a−b)=sin⁡[(x−b)−(x−a)]=sin⁡(x−b)cos⁡(x−a)−cos⁡(x−b)sin⁡(x−a)\sin(a - b) = \sin[(x - b) - (x - a)] = \sin(x - b)\cos(x - a) - \cos(x - b)\sin(x - a)

Divide through by the denominator:

sin⁡(a−b)sin⁡(x−a)sin⁡(x−b)=sin⁡(x−b)cos⁡(x−a)sin⁡(x−a)sin⁡(x−b)−cos⁡(x−b)sin⁡(x−a)sin⁡(x−a)sin⁡(x−b)\frac{\sin(a - b)}{\sin(x - a)\sin(x - b)} = \frac{\sin(x - b)\cos(x - a)}{\sin(x - a)\sin(x - b)} - \frac{\cos(x - b)\sin(x - a)}{\sin(x - a)\sin(x - b)} sin⁡(a−b)sin⁡(x−a)sin⁡(x−b)=cot⁡(x−a)−cot⁡(x−b)\frac{\sin(a - b)}{\sin(x - a)\sin(x - b)} = \cot(x - a) - \cot(x - b)

Integrate directly:

I=1sin⁡(a−b)∫[cot⁡(x−a)−cot⁡(x−b)]dxI = \frac{1}{\sin(a - b)}\int [\cot(x - a) - \cot(x - b)]dx I=1sin⁡(a−b)(ln⁡∣sin⁡(x−a)∣−ln⁡∣sin⁡(x−b)∣)+CI = \frac{1}{\sin(a - b)}\left( \ln|\sin(x - a)| - \ln|\sin(x - b)| \right) + C

Applying the logarithm quotient rule:

I=1sin⁡(a−b)ln⁡∣sin⁡(x−a)sin⁡(x−b)∣+CI = \frac{1}{\sin(a - b)}\ln\left| \frac{\sin(x - a)}{\sin(x - b)} \right| + C

Example 15§

Evaluate:

I=∫dxcos⁡(x−a)cos⁡(x−b)I = \int \frac{dx}{\cos(x - a)\cos(x - b)}

Solution:

Both factors are cosines (same kind), so multiply and divide by sin⁡(a−b)\sin(a - b):

I=1sin⁡(a−b)∫sin⁡[(x−b)−(x−a)]cos⁡(x−a)cos⁡(x−b) dxI = \frac{1}{\sin(a - b)}\int \frac{\sin[(x - b) - (x - a)]}{\cos(x - a)\cos(x - b)}\,dx

Expand the numerator:

sin⁡[(x−b)−(x−a)]=sin⁡(x−b)cos⁡(x−a)−cos⁡(x−b)sin⁡(x−a)\sin[(x - b) - (x - a)] = \sin(x - b)\cos(x - a) - \cos(x - b)\sin(x - a)

Divide by the denominator:

sin⁡(x−b)cos⁡(x−a)cos⁡(x−a)cos⁡(x−b)−cos⁡(x−b)sin⁡(x−a)cos⁡(x−a)cos⁡(x−b)=tan⁡(x−b)−tan⁡(x−a)\frac{\sin(x - b)\cos(x - a)}{\cos(x - a)\cos(x - b)} - \frac{\cos(x - b)\sin(x - a)}{\cos(x - a)\cos(x - b)} = \tan(x - b) - \tan(x - a)

Substitute into the integral:

I=1sin⁡(a−b)∫[tan⁡(x−b)−tan⁡(x−a)]dxI = \frac{1}{\sin(a - b)}\int [\tan(x - b) - \tan(x - a)]dx

Recall that ∫tan⁡u du=−ln⁡∣cos⁡u∣\int \tan u\,du = -\ln|\cos u|:

I=1sin⁡(a−b)(−ln⁡∣cos⁡(x−b)∣+ln⁡∣cos⁡(x−a)∣)+CI = \frac{1}{\sin(a - b)}\left( -\ln|\cos(x - b)| + \ln|\cos(x - a)| \right) + C I=1sin⁡(a−b)ln⁡∣cos⁡(x−a)cos⁡(x−b)∣+CI = \frac{1}{\sin(a - b)}\ln\left| \frac{\cos(x - a)}{\cos(x - b)} \right| + C

Example 16§

Evaluate:

I=∫dxsin⁡(x−a)cos⁡(x−b)I = \int \frac{dx}{\sin(x - a)\cos(x - b)}

Solution:

Here the factors in the denominator are mixed (one sine and one cosine). Multiply and divide by cos⁡(a−b)\cos(a - b):

I=1cos⁡(a−b)∫cos⁡[(x−a)−(x−b)]sin⁡(x−a)cos⁡(x−b) dxI = \frac{1}{\cos(a - b)}\int \frac{\cos[(x - a) - (x - b)]}{\sin(x - a)\cos(x - b)}\,dx

Expand using the cosine subtraction formula cos⁡(A−B)=cos⁡Acos⁡B+sin⁡Asin⁡B\cos(A - B) = \cos A\cos B + \sin A\sin B:

cos⁡[(x−a)−(x−b)]=cos⁡(x−a)cos⁡(x−b)+sin⁡(x−a)sin⁡(x−b)\cos[(x - a) - (x - b)] = \cos(x - a)\cos(x - b) + \sin(x - a)\sin(x - b)

Divide through by the denominator:

cos⁡(x−a)cos⁡(x−b)sin⁡(x−a)cos⁡(x−b)+sin⁡(x−a)sin⁡(x−b)sin⁡(x−a)cos⁡(x−b)=cot⁡(x−a)+tan⁡(x−b)\frac{\cos(x - a)\cos(x - b)}{\sin(x - a)\cos(x - b)} + \frac{\sin(x - a)\sin(x - b)}{\sin(x - a)\cos(x - b)} = \cot(x - a) + \tan(x - b)

Substitute into the integral:

I=1cos⁡(a−b)∫[cot⁡(x−a)+tan⁡(x−b)]dxI = \frac{1}{\cos(a - b)}\int [\cot(x - a) + \tan(x - b)]dx

Integrating:

I=1cos⁡(a−b)(ln⁡∣sin⁡(x−a)∣−ln⁡∣cos⁡(x−b)∣)+CI = \frac{1}{\cos(a - b)}\left( \ln|\sin(x - a)| - \ln|\cos(x - b)| \right) + C

Combining the logarithms:

I=1cos⁡(a−b)ln⁡∣sin⁡(x−a)cos⁡(x−b)∣+CI = \frac{1}{\cos(a - b)}\ln\left| \frac{\sin(x - a)}{\cos(x - b)} \right| + C
Section 10 of 10 · Indefinite Integration

Mark this section complete when you have worked through its proofs.