Skip to content

Integration via Algebraic and Trigonometric Transformations

In our previous tutorial, we established the table of standard antiderivatives and learned how to handle linear arguments of the form \(ax + b\).

Now we confront the reality of indefinite integration:

The Golden Rule of Integration: You can only integrate an expression if it directly matches a formula in your standard table, or if it can be broken down into a sum of pieces that match the table.

In Differential Calculus, computing a derivative is mechanical. If you are given a complicated fraction or product, you simply apply the quotient rule, product rule, or chain rule.

In Integral Calculus, there is no general quotient rule or product rule that solves an arbitrary fraction or product directly. If an integral does not match our table, we cannot integrate it as it stands.

What do we do?

We use algebraic and trigonometric transformation: reshaping, expanding, factoring, dividing, or applying identities to rewrite the integrand into a sum of elementary terms that our table already knows how to integrate.

Crucially, these manipulations are not rigid formulas with official names. There is rarely only one way to reshape an expression. Often, two students using completely different algebraic insights will arrive at the same correct answer through entirely different paths.

In this tutorial, we explore the primary goals of algebraic and trigonometric transformation, examining a wide variety of examples and alternative pathways.


Expanding Products and Dividing Monomials

When an integrand is a product of simple polynomials or powers, or when a fraction has only a single term in the denominator, the most natural first step is direct expansion and term-by-term division.

Example 1

Evaluate the indefinite integral:

\[I = \int \left( x + \frac{1}{x} \right)^3\,dx\]

Solution:

We cannot integrate this using the power rule directly on \((x + 1/x)\) because the inner expression is not linear.

Instead, expand the cube using the algebraic identity \((a + b)^3 = a^3 + 3a^2 b + 3ab^2 + b^3\):

\[\left( x + \frac{1}{x} \right)^3 = x^3 + 3x^2\left(\frac{1}{x}\right) + 3x\left(\frac{1}{x^2}\right) + \frac{1}{x^3} = x^3 + 3x + \frac{3}{x} + x^{-3}\]

Every single piece is now a standard power or logarithm:

\[I = \int \left( x^3 + 3x + \frac{3}{x} + x^{-3} \right)\,dx\]

Integrate term by term:

\[I = \frac{x^4}{4} + \frac{3x^2}{2} + 3\ln|x| - \frac{1}{2x^2} + C\]

Example 2

Evaluate:

\[I = \int \frac{x^3 - 4x^2 + 5\sqrt{x} - 2}{x\sqrt{x}}\,dx\]

Solution:

The denominator is a single term: \(x\sqrt{x} = x^{3/2}\). Divide each term in the numerator by \(x^{3/2}\):

\[\frac{x^3}{x^{3/2}} = x^{3/2}\]
\[\frac{-4x^2}{x^{3/2}} = -4x^{1/2}\]
\[\frac{5x^{1/2}}{x^{3/2}} = 5x^{-1} = \frac{5}{x}\]
\[\frac{-2}{x^{3/2}} = -2x^{-3/2}\]

Now integrate each term using standard power and logarithmic formulas:

\[I = \int \left( x^{3/2} - 4x^{1/2} + \frac{5}{x} - 2x^{-3/2} \right)\,dx\]
\[I = \frac{x^{5/2}}{5/2} - 4\left(\frac{x^{3/2}}{3/2}\right) + 5\ln|x| - 2\left(\frac{x^{-1/2}}{-1/2}\right) + C\]
\[I = \frac{2}{5}x^{5/2} - \frac{8}{3}x^{3/2} + 5\ln|x| + \frac{4}{\sqrt{x}} + C\]

Simplifying Exponential and Logarithmic Expressions

Sometimes an expression looks intimidating only because it is written with logarithms inside exponents. Applying standard logarithmic identities will often collapse the integrand into a simple polynomial.

Example 3

Evaluate:

\[I = \int \frac{e^{5\ln x} - e^{4\ln x}}{e^{3\ln x} - e^{2\ln x}}\,dx \qquad (x > 0, x \neq 1)\]

Solution:

Recall the fundamental identity relating exponentials and natural logarithms:

\[e^{k \ln x} = e^{\ln(x^k)} = x^k\]

Apply this identity to all four terms:

  • \(e^{5\ln x} = x^5\)
  • \(e^{4\ln x} = x^4\)
  • \(e^{3\ln x} = x^3\)
  • \(e^{2\ln x} = x^2\)

The fraction becomes:

\[\frac{x^5 - x^4}{x^3 - x^2} = \frac{x^4(x - 1)}{x^2(x - 1)}\]

For \(x \neq 1\), the common factor \((x - 1)\) cancels:

\[\frac{x^4(x - 1)}{x^2(x - 1)} = \frac{x^4}{x^2} = x^2\]

The entire problem reduces to integrating a simple quadratic:

\[I = \int x^2\,dx = \frac{x^3}{3} + C\]

Handling Fractions where the Numerator Degree Exceeds or Equals the Denominator

An algebraic fraction \(\frac{P(x)}{Q(x)}\) is called improper if:

\[\deg(P) \ge \deg(Q)\]

General Rule of Thumb: Whenever the degree of the numerator is greater than or equal to the degree of the denominator, never attempt to integrate directly. Either perform polynomial division or rewrite the numerator to create terms matching the denominator:

\[\frac{P(x)}{Q(x)} = \text{Quotient}(x) + \frac{\text{Remainder}(x)}{Q(x)}\]

Example 4

Evaluate:

\[I = \int \frac{x^2}{x^2 + 1}\,dx\]

Solution:

Both numerator and denominator have degree \(2\). Add and subtract \(1\) in the numerator:

\[\frac{x^2}{x^2 + 1} = \frac{(x^2 + 1) - 1}{x^2 + 1} = 1 - \frac{1}{x^2 + 1}\]

Now both pieces match standard forms:

\[I = \int \left( 1 - \frac{1}{1 + x^2} \right)\,dx = x - \arctan x + C\]

Example 5

Evaluate:

\[I = \int \frac{x^4}{x^2 + 1}\,dx\]

Solution:

Add and subtract \(1\) in the numerator to factor out the difference of squares \((x^4 - 1)\):

\[\frac{x^4}{x^2 + 1} = \frac{(x^4 - 1) + 1}{x^2 + 1} = \frac{(x^2 - 1)(x^2 + 1) + 1}{x^2 + 1} = x^2 - 1 + \frac{1}{x^2 + 1}\]

Integrate term by term:

\[I = \int \left( x^2 - 1 + \frac{1}{1 + x^2} \right)\,dx = \frac{x^3}{3} - x + \arctan x + C\]

Example 6

Evaluate:

\[I = \int \frac{x^2 - 1}{x^2 + 1}\,dx\]

Solution:

Write the numerator as \((x^2 + 1) - 2\):

\[\frac{x^2 - 1}{x^2 + 1} = \frac{(x^2 + 1) - 2}{x^2 + 1} = 1 - \frac{2}{x^2 + 1}\]

Integrate:

\[I = \int \left( 1 - \frac{2}{1 + x^2} \right)\,dx = x - 2\arctan x + C\]

Example 7

Evaluate:

\[I = \int \frac{x^3}{x + 2}\,dx\]

Solution:

The numerator degree (\(3\)) is larger than the denominator degree (\(1\)).

We can add and subtract \(8 = 2^3\) to use the sum of cubes factorization \(a^3 + b^3 = (a + b)(a^2 - ab + b^2)\):

\[x^3 = (x^3 + 8) - 8 = (x + 2)(x^2 - 2x + 4) - 8\]

Divide through by \((x + 2)\):

\[\frac{x^3}{x + 2} = x^2 - 2x + 4 - \frac{8}{x + 2}\]

Integrate each term:

\[I = \int \left( x^2 - 2x + 4 - \frac{8}{x + 2} \right)\,dx = \frac{x^3}{3} - x^2 + 4x - 8\ln|x + 2| + C\]

Rewriting Numerators for Repeated Linear Denominators

When the denominator has the form \((x + a)^n\) and the numerator is a polynomial, express the variable \(x\) in the numerator in terms of \((x + a)\).

Example 8

Evaluate:

\[I = \int \frac{x}{(x + 3)^2}\,dx\]

Solution:

Rewrite \(x\) as \((x + 3) - 3\):

\[\frac{x}{(x + 3)^2} = \frac{(x + 3) - 3}{(x + 3)^2} = \frac{1}{x + 3} - \frac{3}{(x + 3)^2}\]

Write as negative powers:

\[\frac{1}{x + 3} - 3(x + 3)^{-2}\]

Integrate using linear argument rules:

\[I = \ln|x + 3| - 3\left(\frac{(x + 3)^{-1}}{-1}\right) + C = \ln|x + 3| + \frac{3}{x + 3} + C\]

Example 9

Evaluate:

\[I = \int \frac{2x + 1}{(x - 2)^2}\,dx\]

Solution:

Rewrite \(2x + 1\) in terms of \((x - 2)\):

\[2x + 1 = 2(x - 2) + 4 + 1 = 2(x - 2) + 5\]

Split the fraction:

\[\frac{2x + 1}{(x - 2)^2} = \frac{2(x - 2) + 5}{(x - 2)^2} = \frac{2}{x - 2} + \frac{5}{(x - 2)^2} = \frac{2}{x - 2} + 5(x - 2)^{-2}\]

Integrate:

\[I = 2\ln|x - 2| + 5\left(\frac{(x - 2)^{-1}}{-1}\right) + C = 2\ln|x - 2| - \frac{5}{x - 2} + C\]

Example 10

Evaluate:

\[I = \int \frac{x^2}{(x + 1)^3}\,dx\]

Solution:

Write \(x = (x + 1) - 1\). Expanding the numerator:

\[x^2 = [(x + 1) - 1]^2 = (x + 1)^2 - 2(x + 1) + 1\]

Divide each term by \((x + 1)^3\):

\[\frac{x^2}{(x + 1)^3} = \frac{1}{x + 1} - 2(x + 1)^{-2} + (x + 1)^{-3}\]

Integrate:

\[I = \ln|x + 1| + \frac{2}{x + 1} - \frac{1}{2(x + 1)^2} + C\]

Example 11

Evaluate:

\[I = \int \frac{x^3 + 3x^2 + 3x + 2}{(x + 1)^2}\,dx\]

Solution:

Notice that the first three terms resemble the expansion \((x + 1)^3 = x^3 + 3x^2 + 3x + 1\).

Rewrite the numerator as:

\[x^3 + 3x^2 + 3x + 2 = (x + 1)^3 + 1\]

Divide by \((x + 1)^2\):

\[\frac{(x + 1)^3 + 1}{(x + 1)^2} = (x + 1) + \frac{1}{(x + 1)^2} = x + 1 + (x + 1)^{-2}\]

Integrate:

\[I = \frac{x^2}{2} + x - \frac{1}{x + 1} + C\]

Rationalizing Square Roots in Denominators

When square roots appear as a sum or difference in the denominator, multiplying numerator and denominator by the conjugate eliminates the roots from the denominator.

Example 12

Evaluate:

\[I = \int \frac{dx}{\sqrt{x + 3} + \sqrt{x + 1}}\]

Solution:

Multiply by the conjugate \((\sqrt{x + 3} - \sqrt{x + 1})\):

\[\frac{\sqrt{x + 3} - \sqrt{x + 1}}{(x + 3) - (x + 1)} = \frac{\sqrt{x + 3} - \sqrt{x + 1}}{2} = \frac{1}{2}(x + 3)^{1/2} - \frac{1}{2}(x + 1)^{1/2}\]

Integrate each linear power:

\[I = \frac{1}{2}\left(\frac{(x + 3)^{3/2}}{3/2}\right) - \frac{1}{2}\left(\frac{(x + 1)^{3/2}}{3/2}\right) + C = \frac{1}{3}(x + 3)^{3/2} - \frac{1}{3}(x + 1)^{3/2} + C\]

Example 13

Evaluate:

\[I = \int \frac{dx}{\sqrt{3x + 2} - \sqrt{3x - 1}}\]

Solution:

Multiply by the conjugate \((\sqrt{3x + 2} + \sqrt{3x - 1})\):

\[\frac{\sqrt{3x + 2} + \sqrt{3x - 1}}{(3x + 2) - (3x - 1)} = \frac{\sqrt{3x + 2} + \sqrt{3x - 1}}{3}\]

Integrate using linear scaling (\(a = 3\)):

\[I = \frac{1}{3} \left[ \frac{(3x + 2)^{3/2}}{3 \cdot \frac{3}{2}} + \frac{(3x - 1)^{3/2}}{3 \cdot \frac{3}{2}} \right] + C = \frac{2}{27}\left[ (3x + 2)^{3/2} + (3x - 1)^{3/2} \right] + C\]

Reducing Powers of Trigonometric Functions

Because \(\frac{d}{dx}[\sin x] = \cos x \neq 1\), we cannot apply the power rule to trigonometric functions like \(\sin^2 x\) or \(\cos^3 x\).

Instead, we use double-angle and triple-angle identities to replace powers with linear trigonometric functions:

\[\sin^2 \theta = \frac{1 - \cos 2\theta}{2}, \qquad \cos^2 \theta = \frac{1 + \cos 2\theta}{2}\]
\[\sin^3 \theta = \frac{3\sin \theta - \sin 3\theta}{4}, \qquad \cos^3 \theta = \frac{3\cos \theta + \cos 3\theta}{4}\]

Example 14

Evaluate:

\[I = \int \sin^2(3x)\,dx\]

Solution:

Using \(\sin^2 \theta = \frac{1 - \cos 2\theta}{2}\) with \(\theta = 3x\):

\[\sin^2(3x) = \frac{1 - \cos(6x)}{2}\]

Integrate:

\[I = \int \left( \frac{1}{2} - \frac{1}{2}\cos(6x) \right)\,dx = \frac{x}{2} - \frac{\sin(6x)}{12} + C\]

Example 15

Evaluate:

\[I = \int \cos^3 x\,dx\]

Solution:

From \(\cos 3x = 4\cos^3 x - 3\cos x\), solve for \(\cos^3 x\):

\[\cos^3 x = \frac{3\cos x + \cos 3x}{4}\]

Integrate:

\[I = \int \left( \frac{3}{4}\cos x + \frac{1}{4}\cos 3x \right)\,dx = \frac{3}{4}\sin x + \frac{\sin 3x}{12} + C\]

Example 16

Evaluate:

\[I = \int \sin^4 x\,dx\]

Solution:

Square the identity for \(\sin^2 x\):

\[\sin^4 x = \left( \frac{1 - \cos 2x}{2} \right)^2 = \frac{1 - 2\cos 2x + \cos^2(2x)}{4}\]

Now reduce \(\cos^2(2x)\) using \(\cos^2(2x) = \frac{1 + \cos 4x}{2}\):

\[\sin^4 x = \frac{1}{4}\left( 1 - 2\cos 2x + \frac{1 + \cos 4x}{2} \right) = \frac{3}{8} - \frac{1}{2}\cos 2x + \frac{1}{8}\cos 4x\]

Now every term is linear:

\[I = \int \left( \frac{3}{8} - \frac{1}{2}\cos 2x + \frac{1}{8}\cos 4x \right)\,dx = \frac{3}{8}x - \frac{\sin 2x}{4} + \frac{\sin 4x}{32} + C\]

Converting Trigonometric Products into Sums

To integrate products like \(\sin(mx)\cos(nx)\), we multiply and divide by \(2\) and use product-to-sum identities:

\[2\sin A \cos B = \sin(A + B) + \sin(A - B)\]
\[2\cos A \sin B = \sin(A + B) - \sin(A - B)\]
\[2\cos A \cos B = \cos(A + B) + \cos(A - B)\]
\[2\sin A \sin B = \cos(A - B) - \cos(A + B)\]

Example 17

Evaluate:

\[I = \int \sin 5x \cos 3x\,dx\]

Solution:

Multiply and divide by \(2\):

\[I = \frac{1}{2} \int 2\sin 5x \cos 3x\,dx = \frac{1}{2} \int [\sin(5x + 3x) + \sin(5x - 3x)]\,dx = \frac{1}{2} \int (\sin 8x + \sin 2x)\,dx\]

Integrate:

\[I = \frac{1}{2}\left( -\frac{\cos 8x}{8} - \frac{\cos 2x}{2} \right) + C = -\frac{\cos 8x}{16} - \frac{\cos 2x}{4} + C\]

Example 18

Evaluate:

\[I = \int \cos x \cos 2x \cos 3x\,dx\]

Solution:

Group \(\cos 3x\) and \(\cos x\):

\[2\cos 3x \cos x = \cos 4x + \cos 2x\]

Multiply by the remaining factor \(\cos 2x\):

\[\cos x \cos 2x \cos 3x = \frac{1}{2}(\cos 4x + \cos 2x)\cos 2x = \frac{1}{2}\cos 4x \cos 2x + \frac{1}{2}\cos^2(2x)\]

Now convert each part:

\[\frac{1}{2}\cos 4x \cos 2x = \frac{1}{4}(2\cos 4x \cos 2x) = \frac{1}{4}(\cos 6x + \cos 2x)\]
\[\frac{1}{2}\cos^2(2x) = \frac{1}{4}(1 + \cos 4x)\]

Combining all terms:

\[\cos x \cos 2x \cos 3x = \frac{1}{4}(1 + \cos 2x + \cos 4x + \cos 6x)\]

Integrate:

\[I = \frac{x}{4} + \frac{\sin 2x}{8} + \frac{\sin 4x}{16} + \frac{\sin 6x}{24} + C\]

Example 19

Evaluate:

\[I = \int \tan x \tan 2x \tan 3x\,dx\]

Solution:

This looks impossible at first glance. But consider the trigonometric compound angle identity:

\[\tan 3x = \tan(x + 2x) = \frac{\tan x + \tan 2x}{1 - \tan x \tan 2x}\]

Cross-multiply:

\[\tan 3x(1 - \tan x \tan 2x) = \tan x + \tan 2x\]
\[\tan 3x - \tan x \tan 2x \tan 3x = \tan x + \tan 2x\]

Rearranging terms:

\[\tan x \tan 2x \tan 3x = \tan 3x - \tan 2x - \tan x\]

The entire product has collapsed into three separate, elementary tangents!

\[I = \int (\tan 3x - \tan 2x - \tan x)\,dx\]

Recall that \(\int \tan(ax)\,dx = \frac{1}{a}\ln|\sec(ax)|\):

\[I = \frac{1}{3}\ln|\sec 3x| - \frac{1}{2}\ln|\sec 2x| - \ln|\sec x| + C\]

Exploring Alternative Pathways: Different Views of the Same Problem

One of the most liberating realizations in calculus is that there is often more than one way to reshape an expression.

Let us look at two famous problems where different algebraic ideas lead to the exact same destination.

Example 20

Evaluate:

\[I = \int \frac{dx}{\sin^2 x \cos^2 x}\]

Let us compare two completely different lines of thought:

Path 1 (Using the Pythagorean Identity):

Notice the number \(1\) in the numerator. Replace \(1\) with \(\sin^2 x + \cos^2 x\):

\[\frac{1}{\sin^2 x \cos^2 x} = \frac{\sin^2 x + \cos^2 x}{\sin^2 x \cos^2 x} = \frac{1}{\cos^2 x} + \frac{1}{\sin^2 x} = \sec^2 x + \csc^2 x\]

Both are basic derivatives:

\[I = \int (\sec^2 x + \csc^2 x)\,dx = \tan x - \cot x + C\]

Path 2 (Using the Double-Angle Sine Identity):

Notice that \(\sin x \cos x = \frac{1}{2}\sin 2x\). Therefore:

\[\sin^2 x \cos^2 x = \frac{1}{4}\sin^2(2x)\]

The fraction becomes:

\[\frac{1}{\sin^2 x \cos^2 x} = \frac{4}{\sin^2(2x)} = 4\csc^2(2x)\]

Now integrate in one step using the linear cosecant-squared formula:

\[I = 4 \int \csc^2(2x)\,dx = 4\left( -\frac{\cot 2x}{2} \right) + C = -2\cot(2x) + C\]

Are the two answers the same?

Yes! Express \(-2\cot(2x)\) in terms of single angles:

\[-2\cot 2x = -2\left( \frac{\cos 2x}{\sin 2x} \right) = -2\left( \frac{\cos^2 x - \sin^2 x}{2\sin x \cos x} \right) = -\frac{\cos^2 x}{\sin x \cos x} + \frac{\sin^2 x}{\sin x \cos x} = -\cot x + \tan x\]

Both paths give the exact same mathematical curve. Path 2 found it in two lines; Path 1 found it by splitting terms. Both are valid.


Example 21

Evaluate:

\[I = \int \frac{dx}{1 + \cos x}\]

Path 1 (Half-Angle Identity):

Recall \(1 + \cos x = 2\cos^2(x/2)\):

\[\frac{1}{1 + \cos x} = \frac{1}{2\cos^2(x/2)} = \frac{1}{2}\sec^2\left(\frac{x}{2}\right)\]

Integrate directly:

\[I = \frac{1}{2} \cdot \frac{\tan(x/2)}{1/2} + C = \tan\left(\frac{x}{2}\right) + C\]

Path 2 (Conjugate Multiplication):

Multiply numerator and denominator by \((1 - \cos x)\):

\[\frac{1 - \cos x}{1 - \cos^2 x} = \frac{1 - \cos x}{\sin^2 x} = \csc^2 x - \csc x \cot x\]

Integrate:

\[I = -\cot x + \csc x + C = \csc x - \cot x + C\]

Since \(\csc x - \cot x = \frac{1 - \cos x}{\sin x} = \frac{2\sin^2(x/2)}{2\sin(x/2)\cos(x/2)} = \tan(x/2)\), both answers are identical.


Example 22

Evaluate:

\[I = \int \frac{dx}{1 + \sin x}\]

Path 1 (Conjugate Multiplication):

Multiply by \((1 - \sin x)\):

\[\frac{1 - \sin x}{1 - \sin^2 x} = \frac{1 - \sin x}{\cos^2 x} = \sec^2 x - \sec x \tan x\]

Integrate:

\[I = \tan x - \sec x + C\]

Path 2 (Co-function Identity):

Convert \(\sin x\) to a cosine using \(\sin x = \cos\left(\frac{\pi}{2} - x\right)\):

\[1 + \sin x = 1 + \cos\left(\frac{\pi}{2} - x\right) = 2\cos^2\left(\frac{\pi}{4} - \frac{x}{2}\right)\]

The integral becomes:

\[I = \int \frac{1}{2}\sec^2\left(\frac{\pi}{4} - \frac{x}{2}\right)\,dx = \frac{1}{2}\left( \frac{\tan(\pi/4 - x/2)}{-1/2} \right) + C = -\tan\left(\frac{\pi}{4} - \frac{x}{2}\right) + C\]

Using the trigonometric identity \(\tan\left(\frac{\pi}{4} - \frac{x}{2}\right) = \sec x - \tan x\), both answers agree completely.


Factoring and Canceling Trigonometric Numerators

Sometimes a trigonometric fraction simplifies because the numerator factors and cancels with the denominator.

Example 23

Evaluate:

\[I = \int \frac{\cos 2x}{\cos x + \sin x}\,dx\]

Solution:

Use \(\cos 2x = \cos^2 x - \sin^2 x\):

\[\cos 2x = (\cos x - \sin x)(\cos x + \sin x)\]

The denominator cancels completely:

\[\frac{\cos 2x}{\cos x + \sin x} = \cos x - \sin x\]

Now integrate:

\[I = \int (\cos x - \sin x)\,dx = \sin x + \cos x + C\]

Example 24

Evaluate:

\[I = \int \frac{\sin^4 x + \cos^4 x}{\sin^2 x \cos^2 x}\,dx\]

Solution:

Write \(\sin^4 x + \cos^4 x\) using completing the square:

\[\sin^4 x + \cos^4 x = (\sin^2 x + \cos^2 x)^2 - 2\sin^2 x \cos^2 x = 1 - 2\sin^2 x \cos^2 x\]

Divide by the denominator:

\[\frac{1 - 2\sin^2 x \cos^2 x}{\sin^2 x \cos^2 x} = \frac{1}{\sin^2 x \cos^2 x} - 2\]

From our earlier example, \(\frac{1}{\sin^2 x \cos^2 x} = \sec^2 x + \csc^2 x\):

\[\frac{\sin^4 x + \cos^4 x}{\sin^2 x \cos^2 x} = \sec^2 x + \csc^2 x - 2\]

Integrate:

\[I = \tan x - \cot x - 2x + C\]

Example 25

Evaluate:

\[I = \int \frac{1 + \cos 4x}{\cot x - \tan x}\,dx\]

Solution:

Simplify numerator and denominator separately using identities:

  1. Numerator: \(1 + \cos 4x = 2\cos^2(2x)\).
  2. Denominator:
\[\cot x - \tan x = \frac{\cos x}{\sin x} - \frac{\sin x}{\cos x} = \frac{\cos^2 x - \sin^2 x}{\sin x \cos x} = \frac{\cos 2x}{\frac{1}{2}\sin 2x} = 2\cot 2x\]

Divide the two:

\[\frac{2\cos^2 2x}{2\cot 2x} = \frac{\cos^2 2x}{\frac{\cos 2x}{\sin 2x}} = \cos 2x \sin 2x = \frac{1}{2}\sin 4x\]

The entire complicated fraction is simply \(\frac{1}{2}\sin 4x\)!

\[I = \frac{1}{2} \int \sin 4x\,dx = -\frac{\cos 4x}{8} + C\]

The Constant-Difference Trick for Shifted Angles

When an integrand contains products of shifted angles in the denominator, such as:

\[\int \frac{dx}{\cos(x - a)\cos(x - b)}\]

we cannot expand the denominator easily.

However, notice that the difference between the two angles is constant:

\[(x - b) - (x - a) = a - b\]

Since \(a - b\) is a constant, \(\sin(a - b)\) is also a constant. Multiply and divide by \(\sin(a - b)\) and expand \(\sin[(x - b) - (x - a)]\) in the numerator:

Example 26

Evaluate:

\[I = \int \frac{dx}{\cos(x - a)\cos(x - b)} \qquad (a \neq b)\]

Solution:

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

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

Expand using \(\sin(A - B) = \sin A \cos B - \cos A \sin B\):

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

Divide term by term:

\[\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)\]

Now integrate:

\[I = \frac{1}{\sin(a - b)} \int [ \tan(x - b) - \tan(x - a) ]\,dx\]
\[I = \frac{1}{\sin(a - b)} [ -\ln|\cos(x - b)| + \ln|\cos(x - a)| ] + C = \frac{1}{\sin(a - b)} \ln\left| \frac{\cos(x - a)}{\cos(x - b)} \right| + C\]

Simplifying Inverse Trigonometric Integrands

Before doing any calculus on an inverse trigonometric function, always check whether trigonometric identities can simplify the inner argument to a linear expression.

Example 27

Evaluate:

\[I = \int \tan^{-1}\left( \sqrt{\frac{1 - \cos 2x}{1 + \cos 2x}} \right)\,dx \qquad \left(0 < x < \frac{\pi}{2}\right)\]

Solution:

Using half-angles:

\[\frac{1 - \cos 2x}{1 + \cos 2x} = \frac{2\sin^2 x}{2\cos^2 x} = \tan^2 x\]

Taking the square root (for \(0 < x < \pi/2\), \(\tan x > 0\)):

\[\tan^{-1}(\tan x) = x\]

Integrate:

\[I = \int x\,dx = \frac{x^2}{2} + C\]

Example 28

Evaluate:

\[I = \int \tan^{-1}\left( \frac{\cos x - \sin x}{\cos x + \sin x} \right)\,dx \qquad \left(-\frac{\pi}{4} < x < \frac{\pi}{4}\right)\]

Solution:

Divide numerator and denominator by \(\cos x\):

\[\frac{\cos x - \sin x}{\cos x + \sin x} = \frac{1 - \tan x}{1 + \tan x} = \tan\left( \frac{\pi}{4} - x \right)\]

Therefore:

\[\tan^{-1}\left[ \tan\left( \frac{\pi}{4} - x \right) \right] = \frac{\pi}{4} - x\]

Integrate:

\[I = \int \left( \frac{\pi}{4} - x \right)\,dx = \frac{\pi x}{4} - \frac{x^2}{2} + C\]

Example 29

Evaluate:

\[I = \int \cos^{-1}\left( \frac{1 - \tan^2 x}{1 + \tan^2 x} \right)\,dx \qquad \left(0 < x < \frac{\pi}{2}\right)\]

Solution:

Recall the double-angle cosine identity in terms of tangent:

\[\cos 2x = \frac{1 - \tan^2 x}{1 + \tan^2 x}\]

Therefore:

\[\cos^{-1}\left( \frac{1 - \tan^2 x}{1 + \tan^2 x} \right) = \cos^{-1}(\cos 2x) = 2x\]

Integrate:

\[I = \int 2x\,dx = x^2 + C\]

Advanced Transformations and Intricate Reductions

Now that we have explored the primary categories of algebraic and trigonometric manipulation, let us examine a collection of advanced and intricate problems.

These problems appear formidable at first glance, but every single one of them yields to thoughtful algebraic factoring, symmetric pairing, or trigonometric restructuring—reducing directly to standard table forms without requiring advanced integration methods like substitution or integration by parts.


Example 30

Evaluate the indefinite integral:

\[I = \int \frac{x^4 + x^2 + 1}{x^2 - x + 1}\,dx\]

Solution:

At first glance, this is a rational function with an improper degree (\(\deg \text{num} = 4\), \(\deg \text{den} = 2\)). While long division is possible, there is a much deeper algebraic symmetry.

Recall the classic algebraic technique of completing the square to factor quartics (related to the Sophie Germain identity):

\[x^4 + x^2 + 1 = (x^4 + 2x^2 + 1) - x^2 = (x^2 + 1)^2 - x^2\]

This is a difference of two squares \(A^2 - B^2 = (A - B)(A + B)\) with \(A = x^2 + 1\) and \(B = x\):

\[(x^2 + 1)^2 - x^2 = (x^2 + 1 - x)(x^2 + 1 + x) = (x^2 - x + 1)(x^2 + x + 1)\]

Notice that the factor \((x^2 - x + 1)\) is identical to the denominator. The fraction simplifies to a quadratic polynomial:

\[\frac{x^4 + x^2 + 1}{x^2 - x + 1} = \frac{(x^2 - x + 1)(x^2 + x + 1)}{x^2 - x + 1} = x^2 + x + 1\]

Now integrate term by term:

\[I = \int (x^2 + x + 1)\,dx = \frac{x^3}{3} + \frac{x^2}{2} + x + C\]

Example 31

Evaluate:

\[I = \int \frac{\cos 7x - \cos 8x}{1 + 2\cos 5x}\,dx\]

Solution:

The angles in the numerator are \(7x\) and \(8x\), while the denominator contains \(5x\). There is no immediate formula in our table.

Let us inspect the denominator: \(1 + 2\cos 5x\). In trigonometry, expressions of the form \(1 + 2\cos\theta\) collapse neatly when multiplied by \(\sin(\theta/2)\):

\[\sin\left(\frac{5x}{2}\right)(1 + 2\cos 5x) = \sin\left(\frac{5x}{2}\right) + 2\cos 5x \sin\left(\frac{5x}{2}\right)\]

Apply the product-to-sum identity \(2\cos A \sin B = \sin(A + B) - \sin(A - B)\):

\[2\cos 5x \sin\left(\frac{5x}{2}\right) = \sin\left(\frac{15x}{2}\right) - \sin\left(\frac{5x}{2}\right)\]

Therefore:

\[\sin\left(\frac{5x}{2}\right)(1 + 2\cos 5x) = \sin\left(\frac{15x}{2}\right)\]

Now look at the numerator: \(\cos 7x - \cos 8x\). Applying the difference-of-cosines identity \(\cos C - \cos D = 2\sin\left(\frac{C+D}{2}\right)\sin\left(\frac{D-C}{2}\right)\):

\[\cos 7x - \cos 8x = 2\sin\left(\frac{15x}{2}\right)\sin\left(\frac{x}{2}\right)\]

Multiply both the numerator and the denominator of the integrand by \(\sin\left(\frac{5x}{2}\right)\):

\[\frac{\cos 7x - \cos 8x}{1 + 2\cos 5x} = \frac{2\sin\left(\frac{15x}{2}\right)\sin\left(\frac{x}{2}\right)\sin\left(\frac{5x}{2}\right)}{\sin\left(\frac{15x}{2}\right)}\]

The term \(\sin\left(\frac{15x}{2}\right)\) cancels between numerator and denominator:

\[= 2\sin\left(\frac{5x}{2}\right)\sin\left(\frac{x}{2}\right)\]

Now apply the product-to-sum identity \(2\sin A \sin B = \cos(A - B) - \cos(A + B)\):

\[2\sin\left(\frac{5x}{2}\right)\sin\left(\frac{x}{2}\right) = \cos\left(\frac{5x - x}{2}\right) - \cos\left(\frac{5x + x}{2}\right) = \cos 2x - \cos 3x\]

The entire quotient simplifies to:

\[\cos 2x - \cos 3x\]

Now integrate directly:

\[I = \int (\cos 2x - \cos 3x)\,dx = \frac{\sin 2x}{2} - \frac{\sin 3x}{3} + C\]

Example 32

Evaluate:

\[I = \int \frac{dx}{\tan x + \cot x + \sec x + \csc x}\]

Solution:

When multiple reciprocal and quotient trigonometric functions appear together in a denominator, converting all terms into sines and cosines often provides the clearest algebraic path:

\[\tan x + \cot x = \frac{\sin x}{\cos x} + \frac{\cos x}{\sin x} = \frac{\sin^2 x + \cos^2 x}{\sin x \cos x} = \frac{1}{\sin x \cos x}\]
\[\sec x + \csc x = \frac{1}{\cos x} + \frac{1}{\sin x} = \frac{\sin x + \cos x}{\sin x \cos x}\]

Combine the terms:

\[\tan x + \cot x + \sec x + \csc x = \frac{1 + \sin x + \cos x}{\sin x \cos x}\]

Taking the reciprocal, the integrand becomes:

\[\frac{\sin x \cos x}{1 + \sin x + \cos x}\]

Now notice the fundamental algebraic link between the sum \((\sin x + \cos x)\) and the product \(\sin x \cos x\):

\[(\sin x + \cos x)^2 = \sin^2 x + \cos^2 x + 2\sin x \cos x = 1 + 2\sin x \cos x\]

Rearranging:

\[2\sin x \cos x = (\sin x + \cos x)^2 - 1\]

The right-hand side is a difference of two squares \(A^2 - 1 = (A - 1)(A + 1)\) where \(A = \sin x + \cos x\):

\[2\sin x \cos x = [(\sin x + \cos x) - 1][(\sin x + \cos x) + 1]\]

Therefore:

\[\sin x \cos x = \frac{1}{2}[(\sin x + \cos x) - 1][(\sin x + \cos x) + 1]\]

Substitute this into the integrand:

\[\frac{\sin x \cos x}{1 + \sin x + \cos x} = \frac{\frac{1}{2}[(\sin x + \cos x) - 1][(\sin x + \cos x) + 1]}{\sin x + \cos x + 1} = \frac{1}{2}(\sin x + \cos x - 1)\]

The denominator has cancelled completely. Now integrate term by term:

\[I = \frac{1}{2}\int (\sin x + \cos x - 1)\,dx = \frac{1}{2}(-\cos x + \sin x - x) + C\]
\[I = \frac{\sin x - \cos x - x}{2} + C\]

Example 33

Evaluate:

\[I = \int \frac{dx}{x^4 - 1}\]

Solution:

We can decompose this rational function using strategic numerator splitting without setting up an algebraic system of linear equations.

First, factor the denominator as a difference of squares:

\[x^4 - 1 = (x^2 - 1)(x^2 + 1)\]

Notice that the difference between the two quadratic factors is a constant:

\[(x^2 + 1) - (x^2 - 1) = 2\]

Introduce this constant into the numerator:

\[\frac{1}{x^4 - 1} = \frac{1}{2} \cdot \frac{(x^2 + 1) - (x^2 - 1)}{(x^2 - 1)(x^2 + 1)} = \frac{1}{2}\left( \frac{1}{x^2 - 1} - \frac{1}{x^2 + 1} \right)\]

Now look at the first fraction, \(\frac{1}{x^2 - 1}\). Factor its denominator into linear terms: \(x^2 - 1 = (x - 1)(x + 1)\).

The difference between \((x + 1)\) and \((x - 1)\) is again the constant \(2\):

\[(x + 1) - (x - 1) = 2\]

Therefore:

\[\frac{1}{x^2 - 1} = \frac{1}{2} \cdot \frac{(x + 1) - (x - 1)}{(x - 1)(x + 1)} = \frac{1}{2}\left( \frac{1}{x - 1} - \frac{1}{x + 1} \right)\]

Substitute this back into our expression for \(\frac{1}{x^4 - 1}\):

\[\frac{1}{x^4 - 1} = \frac{1}{2}\left[ \frac{1}{2}\left( \frac{1}{x - 1} - \frac{1}{x + 1} \right) - \frac{1}{x^2 + 1} \right] = \frac{1}{4}\left( \frac{1}{x - 1} - \frac{1}{x + 1} \right) - \frac{1}{2}\left( \frac{1}{x^2 + 1} \right)\]

Every single piece is now a standard table form:

\[I = \frac{1}{4}\int \frac{dx}{x - 1} - \frac{1}{4}\int \frac{dx}{x + 1} - \frac{1}{2}\int \frac{dx}{x^2 + 1}\]
\[I = \frac{1}{4}\ln|x - 1| - \frac{1}{4}\ln|x + 1| - \frac{1}{2}\tan^{-1} x + C\]

Combine the logarithms:

\[I = \frac{1}{4}\ln\left|\frac{x - 1}{x + 1}\right| - \frac{1}{2}\tan^{-1} x + C\]

Example 34

Evaluate:

\[I = \int \sqrt{1 + \sin 2x}\,dx\]

Solution:

Replace \(1\) with \(\cos^2 x + \sin^2 x\) and \(\sin 2x\) with \(2\sin x \cos x\):

\[1 + \sin 2x = \cos^2 x + 2\sin x \cos x + \sin^2 x = (\cos x + \sin x)^2\]

Taking the square root requires careful attention:

\[\sqrt{1 + \sin 2x} = \sqrt{(\cos x + \sin x)^2} = |\cos x + \sin x|\]

Caution on Radicals: Never write \(\sqrt{u^2} = u\) unless you are certain that \(u \ge 0\). The square root function always returns the non-negative root, so \(\sqrt{u^2} = |u|\).

To evaluate the integral, we inspect the sign of \(\cos x + \sin x\). Rewrite it in single-wave form:

\[\cos x + \sin x = \sqrt{2}\left( \frac{1}{\sqrt{2}}\cos x + \frac{1}{\sqrt{2}}\sin x \right) = \sqrt{2}\cos\left( x - \frac{\pi}{4} \right)\]

On intervals where \(\cos x + \sin x \ge 0\) (for example, when \(-\frac{\pi}{4} \le x \le \frac{3\pi}{4}\)):

\[|\cos x + \sin x| = \cos x + \sin x\]
\[I = \int (\cos x + \sin x)\,dx = \sin x - \cos x + C_1\]

On intervals where \(\cos x + \sin x < 0\) (for example, when \(\frac{3\pi}{4} < x < \frac{7\pi}{4}\)):

\[|\cos x + \sin x| = -(\cos x + \sin x)\]
\[I = \int -(\cos x + \sin x)\,dx = -\sin x + \cos x + C_2\]

In concise piecewise notation:

\[I = \operatorname{sgn}(\cos x + \sin x)(\sin x - \cos x) + C\]

Example 35

Evaluate:

\[I = \int \frac{\sin^8 x - \cos^8 x}{1 - 2\sin^2 x \cos^2 x}\,dx\]

Solution:

Differences of even powers can be factored repeatedly using the difference of squares identity:

\[\sin^8 x - \cos^8 x = (\sin^4 x - \cos^4 x)(\sin^4 x + \cos^4 x)\]

Factor the first term again:

\[\sin^4 x - \cos^4 x = (\sin^2 x - \cos^2 x)(\sin^2 x + \cos^2 x)\]

Since \(\sin^2 x + \cos^2 x = 1\) and \(\sin^2 x - \cos^2 x = -(\cos^2 x - \sin^2 x) = -\cos 2x\):

\[\sin^4 x - \cos^4 x = -\cos 2x\]

Now examine the second term, \(\sin^4 x + \cos^4 x\). Complete the square:

\[\sin^4 x + \cos^4 x = (\sin^2 x + \cos^2 x)^2 - 2\sin^2 x \cos^2 x = 1^2 - 2\sin^2 x \cos^2 x = 1 - 2\sin^2 x \cos^2 x\]

Substitute both factors back into the numerator:

\[\sin^8 x - \cos^8 x = (-\cos 2x)(1 - 2\sin^2 x \cos^2 x)\]

The factor \((1 - 2\sin^2 x \cos^2 x)\) matches the denominator:

\[\frac{\sin^8 x - \cos^8 x}{1 - 2\sin^2 x \cos^2 x} = \frac{(-\cos 2x)(1 - 2\sin^2 x \cos^2 x)}{1 - 2\sin^2 x \cos^2 x} = -\cos 2x\]

Now integrate directly:

\[I = \int (-\cos 2x)\,dx = -\frac{\sin 2x}{2} + C\]

Example 36

Evaluate:

\[I = \int \frac{x^6 - 1}{x^2 + 1}\,dx\]

Solution:

The degree of the numerator (\(6\)) exceeds the degree of the denominator (\(2\)). Rather than performing long division, we can use the sum-of-cubes factorization \((a^3 + b^3) = (a + b)(a^2 - ab + b^2)\) by setting \(a = x^2\) and \(b = 1\):

\[x^6 + 1 = (x^2)^3 + 1^3 = (x^2 + 1)(x^4 - x^2 + 1)\]

Rewrite the numerator \(x^6 - 1\) to expose \(x^6 + 1\):

\[x^6 - 1 = (x^6 + 1) - 2 = (x^2 + 1)(x^4 - x^2 + 1) - 2\]

Now divide term by term:

\[\frac{x^6 - 1}{x^2 + 1} = \frac{(x^2 + 1)(x^4 - x^2 + 1) - 2}{x^2 + 1} = x^4 - x^2 + 1 - \frac{2}{x^2 + 1}\]

Every single term matches our standard table:

\[I = \int \left( x^4 - x^2 + 1 - \frac{2}{x^2 + 1} \right)\,dx\]
\[I = \frac{x^5}{5} - \frac{x^3}{3} + x - 2\tan^{-1} x + C\]

Example 37

Evaluate:

\[I = \int \frac{\sin(x - \alpha)}{\sin(x - \beta)}\,dx\]

where \(\alpha\) and \(\beta\) are real constants.

Solution:

When a denominator has a shifted argument like \(\sin(x - \beta)\), we cannot split the denominator. The strategic move is to express the numerator's angle in terms of the denominator's angle:

\[x - \alpha = (x - \beta) + (\beta - \alpha)\]

Now apply the compound angle identity \(\sin(A + B) = \sin A \cos B + \cos A \sin B\) with \(A = x - \beta\) and \(B = \beta - \alpha\):

\[\sin(x - \alpha) = \sin[(x - \beta) + (\beta - \alpha)] = \sin(x - \beta)\cos(\beta - \alpha) + \cos(x - \beta)\sin(\beta - \alpha)\]

Divide through by \(\sin(x - \beta)\):

\[\frac{\sin(x - \alpha)}{\sin(x - \beta)} = \frac{\sin(x - \beta)\cos(\beta - \alpha)}{\sin(x - \beta)} + \frac{\cos(x - \beta)\sin(\beta - \alpha)}{\sin(x - \beta)}\]
\[\frac{\sin(x - \alpha)}{\sin(x - \beta)} = \cos(\beta - \alpha) + \sin(\beta - \alpha)\cot(x - \beta)\]

Notice that \(\alpha\) and \(\beta\) are fixed constants. Therefore, \(\cos(\beta - \alpha)\) and \(\sin(\beta - \alpha)\) are merely scalar coefficients.

Integrate term by term:

\[I = \cos(\beta - \alpha)\int 1\,dx + \sin(\beta - \alpha)\int \cot(x - \beta)\,dx\]

From our standard table, \(\int 1\,dx = x\) and \(\int \cot(u)\,du = \ln|\sin u|\). Since the linear coefficient of \(x\) inside \((x - \beta)\) is \(1\):

\[I = x\cos(\beta - \alpha) + \sin(\beta - \alpha)\ln|\sin(x - \beta)| + C\]

Example 38

Evaluate:

\[I = \int \frac{\sin 3x + \sin 5x + \sin 7x + \sin 9x}{\cos 3x + \cos 5x + \cos 7x + \cos 9x}\,dx\]

Solution:

Both numerator and denominator consist of four angles in arithmetic progression: \(3x, 5x, 7x, 9x\).

When angles form a symmetric arithmetic progression, pair the extreme terms together so that the sum-to-product identities produce common factors:

Pair \(9x\) with \(3x\) (average angle \(\frac{9x+3x}{2} = 6x\)), and pair \(7x\) with \(5x\) (average angle \(\frac{7x+5x}{2} = 6x\)).

Numerator Analysis:

\[(\sin 9x + \sin 3x) + (\sin 7x + \sin 5x)\]

Apply \(\sin A + \sin B = 2\sin\left(\frac{A+B}{2}\right)\cos\left(\frac{A-B}{2}\right)\):

\[\sin 9x + \sin 3x = 2\sin 6x \cos 3x\]
\[\sin 7x + \sin 5x = 2\sin 6x \cos x\]

Factor out the common term \(2\sin 6x\):

\[\text{Numerator} = 2\sin 6x (\cos 3x + \cos x)\]

Denominator Analysis:

\[(\cos 9x + \cos 3x) + (\cos 7x + \cos 5x)\]

Apply \(\cos A + \cos B = 2\cos\left(\frac{A+B}{2}\right)\cos\left(\frac{A-B}{2}\right)\):

\[\cos 9x + \cos 3x = 2\cos 6x \cos 3x\]
\[\cos 7x + \cos 5x = 2\cos 6x \cos x\]

Factor out the common term \(2\cos 6x\):

\[\text{Denominator} = 2\cos 6x (\cos 3x + \cos x)\]

Simplifying the Quotient:

\[\frac{\text{Numerator}}{\text{Denominator}} = \frac{2\sin 6x (\cos 3x + \cos x)}{2\cos 6x (\cos 3x + \cos x)} = \frac{\sin 6x}{\cos 6x} = \tan 6x\]

The entire bracketed expression \((\cos 3x + \cos x)\) cancels completely. Now integrate using our standard formula for \(\tan(ax)\):

\[I = \int \tan 6x\,dx = \frac{1}{6}\ln|\sec 6x| + C\]

Example 39

Evaluate:

\[I = \int \frac{x^2 + 1}{(x + 1)^2}\,dx\]

Solution:

When a rational integrand has a power of a linear binomial in the denominator, attempting standard polynomial division can be cumbersome.

Instead, center the numerator around the linear factor \((x + 1)\) by substituting \(x = (x + 1) - 1\):

\[x^2 + 1 = [(x + 1) - 1]^2 + 1\]

Expand the squared term in powers of \((x + 1)\):

\[[(x + 1) - 1]^2 + 1 = (x + 1)^2 - 2(x + 1) + 1 + 1 = (x + 1)^2 - 2(x + 1) + 2\]

Now divide term by term by \((x + 1)^2\):

\[\frac{x^2 + 1}{(x + 1)^2} = \frac{(x + 1)^2 - 2(x + 1) + 2}{(x + 1)^2} = 1 - \frac{2}{x + 1} + \frac{2}{(x + 1)^2}\]

Every single term is now in standard integrable form:

\[I = \int \left( 1 - \frac{2}{x + 1} + 2(x + 1)^{-2} \right)\,dx\]

Integrate each piece:

  • \(\int 1\,dx = x\)
  • \(\int \frac{2}{x + 1}\,dx = 2\ln|x + 1|\)
  • \(\int 2(x + 1)^{-2}\,dx = 2\left(\frac{(x + 1)^{-1}}{-1}\right) = -\frac{2}{x + 1}\)

Combining these results:

\[I = x - 2\ln|x + 1| - \frac{2}{x + 1} + C\]

Example 40

Evaluate:

\[I = \int \frac{dx}{\sin(x - a)\sin(x - b)}\]

Solution:

The denominator is a product of two sine factors whose arguments vary with \(x\). Notice that the difference between the two angles is constant:

\[(x - a) - (x - b) = b - a\]

Because \(b - a\) is independent of \(x\), \(\sin(b - a)\) is a constant scalar (assuming \(b - a \neq k\pi\)).

Multiply and divide the integrand by \(\sin(b - a)\):

\[I = \frac{1}{\sin(b - a)} \int \frac{\sin[(x - a) - (x - b)]}{\sin(x - a)\sin(x - b)}\,dx\]

Expand the numerator using the compound angle identity \(\sin(A - B) = \sin A \cos B - \cos A \sin B\):

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

Now divide term by term:

\[\frac{\sin(x - a)\cos(x - b) - \cos(x - a)\sin(x - b)}{\sin(x - a)\sin(x - b)} = \frac{\cos(x - b)}{\sin(x - b)} - \frac{\cos(x - a)}{\sin(x - a)} = \cot(x - b) - \cot(x - a)\]

The integral splits into two elementary cotangent terms:

\[I = \frac{1}{\sin(b - a)} \int \left[ \cot(x - b) - \cot(x - a) \right]\,dx\]

Recall from our standard table that \(\int \cot(u)\,du = \ln|\sin u|\). Since the linear coefficient of \(x\) is \(1\):

\[I = \frac{1}{\sin(b - a)} \left( \ln|\sin(x - b)| - \ln|\sin(x - a)| \right) + C\]

Combining the logarithmic terms:

\[I = \frac{1}{\sin(b - a)} \ln\left| \frac{\sin(x - b)}{\sin(x - a)} \right| + C\]

Example 41

Evaluate:

\[I = \int \frac{dx}{\sin(x - a)\cos(x - b)}\]

Solution:

Here the denominator mixes a sine and a cosine factor. The angle difference is again constant:

\[(x - a) - (x - b) = b - a\]

If we were to multiply by \(\sin(b - a)\), the numerator expansion \(\sin(x - a)\cos(x - b) - \cos(x - a)\sin(x - b)\) would yield \(1 - \cot(x - a)\tan(x - b)\), which cannot be split term by term.

Instead, multiply and divide by \(\cos(b - a)\):

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

Expand the numerator using \(\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)\]

Divide each term in the numerator by the denominator:

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

Both terms are standard forms:

\[I = \frac{1}{\cos(b - a)} \int \left[ \cot(x - a) + \tan(x - b) \right]\,dx\]

Using \(\int \cot u\,du = \ln|\sin u|\) and \(\int \tan u\,du = -\ln|\cos u|\):

\[I = \frac{1}{\cos(b - a)} \left( \ln|\sin(x - a)| - \ln|\cos(x - b)| \right) + C\]
\[I = \frac{1}{\cos(b - a)} \ln\left| \frac{\sin(x - a)}{\cos(x - b)} \right| + C\]

Example 42

Evaluate:

\[I = \int \frac{\sin^6 x + \cos^6 x}{\sin^2 x \cos^2 x}\,dx\]

Solution:

Factor the sum of sixth powers as a sum of cubes \((a^3 + b^3) = (a + b)(a^2 - ab + b^2)\) where \(a = \sin^2 x\) and \(b = \cos^2 x\):

\[\sin^6 x + \cos^6 x = (\sin^2 x + \cos^2 x)(\sin^4 x - \sin^2 x \cos^2 x + \cos^4 x)\]

Since \(\sin^2 x + \cos^2 x = 1\), and completing the square gives \(\sin^4 x + \cos^4 x = (\sin^2 x + \cos^2 x)^2 - 2\sin^2 x \cos^2 x = 1 - 2\sin^2 x \cos^2 x\):

\[\sin^6 x + \cos^6 x = 1 \cdot (1 - 2\sin^2 x \cos^2 x - \sin^2 x \cos^2 x) = 1 - 3\sin^2 x \cos^2 x\]

Now divide term by term:

\[\frac{\sin^6 x + \cos^6 x}{\sin^2 x \cos^2 x} = \frac{1 - 3\sin^2 x \cos^2 x}{\sin^2 x \cos^2 x} = \frac{1}{\sin^2 x \cos^2 x} - 3\]

Rewrite the first fraction by replacing \(1\) with \(\sin^2 x + \cos^2 x\):

\[\frac{1}{\sin^2 x \cos^2 x} = \frac{\sin^2 x + \cos^2 x}{\sin^2 x \cos^2 x} = \frac{1}{\cos^2 x} + \frac{1}{\sin^2 x} = \sec^2 x + \csc^2 x\]

The entire integrand collapses to:

\[\sec^2 x + \csc^2 x - 3\]

Integrate term by term:

\[I = \int (\sec^2 x + \csc^2 x - 3)\,dx = \tan x - \cot x - 3x + C\]

Example 43

Evaluate:

\[I = \int \frac{\cos 2x - \cos 2\alpha}{\cos x - \cos \alpha}\,dx\]

where \(\alpha\) is a real constant.

Solution:

Express \(\cos 2x\) and \(\cos 2\alpha\) using the double-angle cosine identity \(\cos 2\theta = 2\cos^2 \theta - 1\):

\[\cos 2x - \cos 2\alpha = (2\cos^2 x - 1) - (2\cos^2 \alpha - 1) = 2(\cos^2 x - \cos^2 \alpha)\]

The term in parentheses is a difference of two squares:

\[2(\cos^2 x - \cos^2 \alpha) = 2(\cos x - \cos \alpha)(\cos x + \cos \alpha)\]

Divide by the denominator \((\cos x - \cos \alpha)\):

\[\frac{\cos 2x - \cos 2\alpha}{\cos x - \cos \alpha} = 2(\cos x + \cos \alpha)\]

Because \(\alpha\) is a constant, \(\cos \alpha\) is a constant scalar:

\[I = \int 2(\cos x + \cos \alpha)\,dx = 2\int \cos x\,dx + 2\cos \alpha \int 1\,dx\]
\[I = 2\sin x + 2x\cos \alpha + C\]

Example 44

Evaluate:

\[I = \int \frac{x}{\sqrt{x + 1} + \sqrt{x - 1}}\,dx \qquad (x \ge 1)\]

Solution:

Multiply the numerator and denominator by the conjugate radical expression \(\sqrt{x + 1} - \sqrt{x - 1}\):

\[\frac{x}{\sqrt{x + 1} + \sqrt{x - 1}} = \frac{x(\sqrt{x + 1} - \sqrt{x - 1})}{(x + 1) - (x - 1)} = \frac{x\sqrt{x + 1} - x\sqrt{x - 1}}{2}\]

To integrate the products \(x\sqrt{x + 1}\) and \(x\sqrt{x - 1}\), rewrite \(x\) around the respective radicands:

For the first term, write \(x = (x + 1) - 1\):

\[x\sqrt{x + 1} = [(x + 1) - 1](x + 1)^{1/2} = (x + 1)^{3/2} - (x + 1)^{1/2}\]

For the second term, write \(x = (x - 1) + 1\):

\[x\sqrt{x - 1} = [(x - 1) + 1](x - 1)^{1/2} = (x - 1)^{3/2} + (x - 1)^{1/2}\]

Substitute these into the integrand:

\[\frac{1}{2}\left[ (x + 1)^{3/2} - (x + 1)^{1/2} - (x - 1)^{3/2} - (x - 1)^{1/2} \right]\]

Now integrate each term using the power rule for linear arguments:

\[I = \frac{1}{2}\left[ \frac{(x + 1)^{5/2}}{5/2} - \frac{(x + 1)^{3/2}}{3/2} - \frac{(x - 1)^{5/2}}{5/2} - \frac{(x - 1)^{3/2}}{3/2} \right] + C\]
\[I = \frac{1}{5}(x + 1)^{5/2} - \frac{1}{3}(x + 1)^{3/2} - \frac{1}{5}(x - 1)^{5/2} - \frac{1}{3}(x - 1)^{3/2} + C\]

Example 45

Evaluate:

\[I = \int \frac{e^{3x} + e^{5x}}{e^x + e^{-x}}\,dx\]

Solution:

Multiply both the numerator and the denominator by \(e^x\) to eliminate the negative exponential:

\[\frac{e^{3x} + e^{5x}}{e^x + e^{-x}} = \frac{e^x(e^{3x} + e^{5x})}{e^x(e^x + e^{-x})} = \frac{e^{4x} + e^{6x}}{e^{2x} + 1}\]

Factor \(e^{4x}\) from the numerator:

\[\frac{e^{4x} + e^{6x}}{e^{2x} + 1} = \frac{e^{4x}(1 + e^{2x})}{e^{2x} + 1} = e^{4x}\]

The fraction simplifies to a single exponential term:

\[I = \int e^{4x}\,dx = \frac{e^{4x}}{4} + C\]

Example 46

Evaluate:

\[I = \int \frac{x^2}{(x^2 + 1)(x^2 + 4)}\,dx\]

Solution:

Notice that the numerator is \(x^2\), while the denominator factors are \((x^2 + 1)\) and \((x^2 + 4)\).

Rather than setting up general partial fractions with undetermined coefficients, observe that \(x^2\) can be expressed as a linear combination of the two denominator factors:

\[4(x^2 + 1) - (x^2 + 4) = 4x^2 + 4 - x^2 - 4 = 3x^2\]

Therefore:

\[x^2 = \frac{1}{3}\left[ 4(x^2 + 1) - (x^2 + 4) \right]\]

Divide this representation by \((x^2 + 1)(x^2 + 4)\):

\[\frac{x^2}{(x^2 + 1)(x^2 + 4)} = \frac{1}{3}\left[ \frac{4(x^2 + 1) - (x^2 + 4)}{(x^2 + 1)(x^2 + 4)} \right] = \frac{1}{3}\left( \frac{4}{x^2 + 4} - \frac{1}{x^2 + 1} \right)\]
\[= \frac{4}{3}\left( \frac{1}{x^2 + 2^2} \right) - \frac{1}{3}\left( \frac{1}{x^2 + 1^2} \right)\]

Both fractions now match the standard inverse tangent antiderivative:

\[\int \frac{dx}{x^2 + a^2} = \frac{1}{a}\tan^{-1}\left(\frac{x}{a}\right)\]

Integrating term by term:

\[I = \frac{4}{3}\left( \frac{1}{2}\tan^{-1}\frac{x}{2} \right) - \frac{1}{3}\tan^{-1} x + C\]
\[I = \frac{2}{3}\tan^{-1}\left(\frac{x}{2}\right) - \frac{1}{3}\tan^{-1} x + C\]

Example 47

Evaluate:

\[I = \int \frac{\sin^3 x + \cos^3 x}{\sin x + \cos x}\,dx\]

Solution:

Apply the sum-of-cubes identity \(a^3 + b^3 = (a + b)(a^2 - ab + b^2)\) to the numerator:

\[\sin^3 x + \cos^3 x = (\sin x + \cos x)(\sin^2 x - \sin x \cos x + \cos^2 x)\]

Since \(\sin^2 x + \cos^2 x = 1\) and \(\sin x \cos x = \frac{1}{2}\sin 2x\):

\[\sin^3 x + \cos^3 x = (\sin x + \cos x)\left( 1 - \frac{1}{2}\sin 2x \right)\]

Divide by the denominator \((\sin x + \cos x)\):

\[\frac{\sin^3 x + \cos^3 x}{\sin x + \cos x} = 1 - \frac{1}{2}\sin 2x\]

Now integrate directly:

\[I = \int \left( 1 - \frac{1}{2}\sin 2x \right)\,dx = x - \frac{1}{2}\left( -\frac{\cos 2x}{2} \right) + C\]
\[I = x + \frac{1}{4}\cos 2x + C\]

Example 48

Evaluate:

\[I = \int \frac{1 + \cos 4x}{\cot x - \tan x}\,dx\]

Solution:

Simplify the numerator and denominator separately using double-angle identities:

Numerator:

\[1 + \cos 4x = 2\cos^2 2x\]

Denominator:

\[\cot x - \tan x = \frac{\cos x}{\sin x} - \frac{\sin x}{\cos x} = \frac{\cos^2 x - \sin^2 x}{\sin x \cos x}\]

Recognize \(\cos^2 x - \sin^2 x = \cos 2x\) and \(\sin x \cos x = \frac{1}{2}\sin 2x\):

\[\cot x - \tan x = \frac{\cos 2x}{\frac{1}{2}\sin 2x} = \frac{2\cos 2x}{\sin 2x}\]

Substitute both into the integrand:

\[\frac{1 + \cos 4x}{\cot x - \tan x} = \frac{2\cos^2 2x}{\frac{2\cos 2x}{\sin 2x}} = \cos 2x \sin 2x\]

Apply the sine double-angle formula \(\cos\theta \sin\theta = \frac{1}{2}\sin 2\theta\) with \(\theta = 2x\):

\[\cos 2x \sin 2x = \frac{1}{2}\sin 4x\]

Now integrate:

\[I = \int \frac{1}{2}\sin 4x\,dx = -\frac{\cos 4x}{8} + C\]

Example 49

Evaluate:

\[I = \int \tan(x - \alpha)\tan(x + \alpha)\tan 2x\,dx\]

where \(\alpha\) is a real constant.

Solution:

Notice the relationship between the three angles:

\[(x - \alpha) + (x + \alpha) = 2x\]

Let \(A = x - \alpha\) and \(B = x + \alpha\), so that \(A + B = 2x\).

Recall the tangent addition formula:

\[\tan(A + B) = \frac{\tan A + \tan B}{1 - \tan A \tan B}\]

Cross-multiply:

\[\tan(A + B)(1 - \tan A \tan B) = \tan A + \tan B\]
\[\tan(A + B) - \tan A \tan B \tan(A + B) = \tan A + \tan B\]

Rearrange to isolate the product \(\tan A \tan B \tan(A + B)\):

\[\tan A \tan B \tan(A + B) = \tan(A + B) - \tan A - \tan B\]

Substituting \(A = x - \alpha\) and \(B = x + \alpha\):

\[\tan(x - \alpha)\tan(x + \alpha)\tan 2x = \tan 2x - \tan(x - \alpha) - \tan(x + \alpha)\]

The three-factor product has transformed into a sum of single tangent terms:

\[I = \int \left[ \tan 2x - \tan(x - \alpha) - \tan(x + \alpha) \right]\,dx\]

Using \(\int \tan(ax)\,dx = \frac{1}{a}\ln|\sec(ax)|\):

\[I = \frac{1}{2}\ln|\sec 2x| - \ln|\sec(x - \alpha)| - \ln|\sec(x + \alpha)| + C\]

Example 50

Evaluate:

\[I = \int \frac{\cos x}{\sqrt{1 + \sin x}}\,dx \qquad \left(-\frac{\pi}{2} < x < \frac{\pi}{2}\right)\]

Solution:

Express both numerator and denominator in half-angles \(\frac{x}{2}\):

Numerator:

\[\cos x = \cos^2\frac{x}{2} - \sin^2\frac{x}{2} = \left(\cos\frac{x}{2} - \sin\frac{x}{2}\right)\left(\cos\frac{x}{2} + \sin\frac{x}{2}\right)\]

Denominator:

\[1 + \sin x = \cos^2\frac{x}{2} + \sin^2\frac{x}{2} + 2\sin\frac{x}{2}\cos\frac{x}{2} = \left(\cos\frac{x}{2} + \sin\frac{x}{2}\right)^2\]

Taking the square root for \(-\frac{\pi}{2} < x < \frac{\pi}{2}\) (where \(\cos\frac{x}{2} + \sin\frac{x}{2} > 0\)):

\[\sqrt{1 + \sin x} = \cos\frac{x}{2} + \sin\frac{x}{2}\]

Substitute into the quotient:

\[\frac{\cos x}{\sqrt{1 + \sin x}} = \frac{\left(\cos\frac{x}{2} - \sin\frac{x}{2}\right)\left(\cos\frac{x}{2} + \sin\frac{x}{2}\right)}{\cos\frac{x}{2} + \sin\frac{x}{2}} = \cos\frac{x}{2} - \sin\frac{x}{2}\]

The fraction has completely reduced to a simple sum of half-angle sines and cosines. Now integrate directly:

\[I = \int \left( \cos\frac{x}{2} - \sin\frac{x}{2} \right)\,dx = \frac{\sin(x/2)}{1/2} - \frac{-\cos(x/2)}{1/2} + C\]
\[I = 2\left(\sin\frac{x}{2} + \cos\frac{x}{2}\right) + C\]

Since \((\sin\frac{x}{2} + \cos\frac{x}{2}) = \sqrt{1 + \sin x}\), this result can also be written in closed radical form:

\[I = 2\sqrt{1 + \sin x} + C\]

The Transformation Mindset: Summary

When an indefinite integral does not match the standard table, your task is not to guess a recipe from memory. Your task is to ask:

  1. Can algebra break it up?
  2. Can you expand brackets?
  3. Can you divide through by a single denominator?
  4. Is the fraction improper (\(\deg \text{num} \ge \deg \text{den}\))? If so, divide first.
  5. Can you add and subtract a constant to create the denominator in the numerator?
  6. Can you rationalize a radical difference?

  7. Can trigonometry simplify it?

  8. Can you reduce higher powers of sine and cosine using double-angle formulas?
  9. Can you turn products into sums using product-to-sum identities?
  10. Can you replace \(1\) with \(\sin^2 x + \cos^2 x\) to split a stubborn denominator?
  11. Can you multiply by a conjugate or use half-angles to turn a two-term denominator into a single term?
  12. Can an inverse trigonometric argument be simplified to a simple polynomial?

What Lies Ahead

Algebraic and trigonometric transformations are the foundation of integration, but they have natural limits.

What happens if an integral contains an inner composite function whose derivative is part of the integrand, such as:

\[\int 2x \cos(x^2)\,dx \qquad \text{or} \qquad \int \frac{\ln x}{x}\,dx\]

No amount of pure algebraic expansion or trigonometric identities will turn these into direct sums of table forms without a change of variable.

In the next tutorial, we master the single most versatile technique in calculus: the Method of Substitution, learning how to systematically reverse the Chain Rule.