# Weierstrass Substitution

The Weierstrass substitution, named after German mathematician Karl Weierstrass $$\left({1815 – 1897}\right),$$ is used for converting rational expressions of trigonometric functions into algebraic rational functions, which may be easier to integrate.

This method of integration is also called the tangent half-angle substitution as it implies the following half-angle identities:

 $$\sin x = {\large\frac{{2\tan \frac{x}{2}}}{{1 + {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{2t}}{{1 + {t^2}}}\normalsize}$$ $$\cos x = {\large\frac{{1 – {{\tan }^2}\frac{x}{2}}}{{1 + {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{1 – {t^2}}}{{1 + {t^2}}}\normalsize}$$ $$\tan x = {\large\frac{{2\tan \frac{x}{2}}}{{1 – {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{2t}}{{1 – {t^2}}}\normalsize}$$ $$\cot x = {\large\frac{{1 – {{\tan }^2}\frac{x}{2}}}{{2\tan \frac{x}{2}}}\normalsize} = {\large\frac{{1 – {t^2}}}{{2t}}\normalsize}$$ $$\sec x = {\large\frac{{1 + {{\tan }^2}\frac{x}{2}}}{{1 – {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{1 + {t^2}}}{{1 – {t^2}}}\normalsize}$$ $$\csc x = {\large\frac{{1 + {{\tan }^2}\frac{x}{2}}}{{2\tan \frac{x}{2}}}\normalsize} = {\large\frac{{1 + {t^2}}}{{2t}}\normalsize}$$
 $$\sin x = {\large\frac{{2\tan \frac{x}{2}}}{{1 + {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{2t}}{{1 + {t^2}}}\normalsize}$$ $$\cos x = {\large\frac{{1 – {{\tan }^2}\frac{x}{2}}}{{1 + {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{1 – {t^2}}}{{1 + {t^2}}}\normalsize}$$ $$\tan x = {\large\frac{{2\tan \frac{x}{2}}}{{1 – {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{2t}}{{1 – {t^2}}}\normalsize}$$ $$\cot x = {\large\frac{{1 – {{\tan }^2}\frac{x}{2}}}{{2\tan \frac{x}{2}}}\normalsize} = {\large\frac{{1 – {t^2}}}{{2t}}\normalsize}$$ $$\sec x = {\large\frac{{1 + {{\tan }^2}\frac{x}{2}}}{{1 – {{\tan }^2}\frac{x}{2}}}\normalsize} = {\large\frac{{1 + {t^2}}}{{1 – {t^2}}}\normalsize}$$ $$\csc x = {\large\frac{{1 + {{\tan }^2}\frac{x}{2}}}{{2\tan \frac{x}{2}}}\normalsize} = {\large\frac{{1 + {t^2}}}{{2t}}\normalsize}$$

where $$t = \tan \large{\frac{x}{2}}\normalsize$$ or $$x = 2\arctan t.$$

The differential $$dx$$ is determined as follows:

${dx = d\left( {2\arctan t} \right) }={ \frac{{2dt}}{{1 + {t^2}}}.}$

Any rational expression of trigonometric functions can be always reduced to integrating a rational function by making the Weierstrass substitution.

The Weierstrass substitution is very useful for integrals involving a simple rational expression in $$\sin x$$ and/or $$\cos x$$ in the denominator.

To calculate an integral of the form $${\large\int\normalsize} {R\left( {\sin x} \right)\cos x\,dx} ,$$ where $$R$$ is a rational function, use the substitution $$t = \sin x.$$

Similarly, to calculate an integral of the form $${\large\int\normalsize} {R\left( {\cos x} \right)\sin x\,dx} ,$$ where $$R$$ is a rational function, use the substitution $$t = \cos x.$$

If an integrand is a function of only $$\tan x,$$ the substitution $$t = \tan x$$ converts this integral into integral of a rational function.

To calculate an integral of the form $${\large\int\normalsize} {R\left( {\sin x} \right)\cos x\,dx} ,$$ where both functions $$\sin x$$ and $$\cos x$$ have even powers, use the substitution $$t = \tan x$$ and the formulas

${{{\cos ^2}x = \frac{1}{{1 + {{\tan }^2}x}} }={ \frac{1}{{1 + {t^2}}},\;\;\;}}\kern0pt {{{\sin ^2}x = \frac{{{{\tan }^2}x}}{{1 + {{\tan }^2}x}} }={ \frac{{{t^2}}}{{1 + {t^2}}}} }$

## Solved Problems

Click or tap a problem to see the solution.

### Example 1

Evaluate the integral $${\large\int\normalsize} {\large\frac{{dx}}{{1 + \sin x}}\normalsize}.$$

### Example 2

Evaluate the integral $$\int {\large{\frac{{dx}}{{3 – 2\sin x}}}\normalsize}.$$

### Example 3

Calculate the integral $${\large\int\normalsize} {\large\frac{{dx}}{{1 + \cos \frac{x}{2}}}\normalsize}.$$

### Example 4

Evaluate the integral $$\int {\large{\frac{{dx}}{{1 + \cos 2x}}}\normalsize}.$$

### Example 5

Compute the integral $$\int {\large{\frac{{dx}}{{4 + 5\cos \frac{x}{2}}}}\normalsize}.$$

### Example 6

Find the integral $${\large\int\normalsize} {\large\frac{{dx}}{{\sin x + \cos x}}\normalsize}.$$

### Example 7

Find the integral $$\int {\large{\frac{{dx}}{{\sin x + \cos x + 1}}}\normalsize}.$$

### Example 8

Evaluate $${\large\int\normalsize} {\large\frac{{dx}}{{\sec x + 1}}\normalsize}.$$

### Example 9

Evaluate the integral $$\int {\large{\frac{{dx}}{{1 + \csc x}}}\normalsize}.$$

### Example 10

Calculate the integral $${\large\int\normalsize} {\large\frac{{dx}}{{{{\sin }^4}x + {{\cos }^4}x}}\normalsize}.$$

### Example 11

Calculate the integral $${\large\int\normalsize} {\large\frac{{dx}}{{a\sin x + b\cos x}}\normalsize}.$$

### Example 12

Find the integral $$\int {\large{\frac{{dx}}{{3\sin x + 4\cos x}}}\normalsize}.$$

### Example 13

Find the integral $$\int {\large{\frac{{dx}}{{5\sin x + 12\cos x}}}\normalsize}.$$

### Example 14

Compute the integral $$\int {\large{\frac{{dx}}{{5\sin x + 2\cos x + 2}}}\normalsize}.$$

### Example 15

Find the integral $$\int {\large{\frac{{dx}}{{2\sin x – \cos x + 5}}}\normalsize}.$$

### Example 16

Find the integral $$\int {\large{\frac{{2dx}}{{4\sin x – 3\cos x + 5}}}\normalsize}.$$

### Example 17

Find the integral $$\int {\large{\frac{{dx}}{{\sin x + \cos x – 1}}}\normalsize}.$$

### Example 18

Find the integral $${\large\int\normalsize} {\large\frac{{dx}}{{1 + \tan x}}\normalsize}.$$

### Example 1.

Evaluate the integral $${\large\int\normalsize} {\large\frac{{dx}}{{1 + \sin x}}\normalsize}.$$

Solution.

We use the universal trigonometric substitution:

${t = \tan \frac{x}{2},\;\;}\Rightarrow {{x = 2\arctan t,\;\;\;}\kern-0.3pt{dx = \frac{{2dt}}{{1 + {t^2}}}.}}$

Since $$\sin x = {\large\frac{{2t}}{{1 + {t^2}}}\normalsize},$$ we have

${\int {\frac{{dx}}{{1 + \sin x}}} } = {\int {\frac{{\frac{{2dt}}{{1 + {t^2}}}}}{{1 + \frac{{2t}}{{1 + {t^2}}}}}} } = {\int {\frac{{2dt}}{{1 + {t^2} + 2t}}} } = {\int {\frac{{2dt}}{{{{\left( {t + 1} \right)}^2}}}} } = { – \frac{2}{{t + 1}} + C } = { – \frac{2}{{\tan \frac{x}{2} + 1}} + C.}$

### Example 2.

Evaluate the integral $$\int {\large{\frac{{dx}}{{3 – 2\sin x}}}\normalsize}.$$

Solution.

Using the Weierstrass substitution

${x = \arctan t,\;\;}\kern0pt{\sin x = \frac{{2t}}{{1 + {t^2}}},\;\;}\kern0pt{dx = \frac{{2dt}}{{1 + {t^2}}},}$

we can rewrite the integral in the form

${I = \int {\frac{{dx}}{{3 – 2\sin x}}} }={ \int {\frac{{\frac{{2dt}}{{1 + {t^2}}}}}{{3 – 2 \cdot \frac{{2t}}{{1 + {t^2}}}}}} }={ \int {\frac{{2dt}}{{3 + 3{t^2} – 4t}}} }={ \int {\frac{{2dt}}{{3\left( {{t^2} – \frac{4}{3}t + 1} \right)}}} }={ \frac{2}{3}\int {\frac{{dt}}{{{t^2} – \frac{4}{3}t + 1}}} .}$

Complete the square in the denominator:

${{t^2} – \frac{4}{3}t + 1 }={ {t^2} – \frac{4}{3}t + {\left( {\frac{2}{3}} \right)^2} – {\left( {\frac{2}{3}} \right)^2} + 1 }={ {\left( {t – \frac{2}{3}} \right)^2} – \frac{4}{9} + 1 }={ {\left( {t – \frac{2}{3}} \right)^2} + \frac{5}{9} }={ {\left( {t – \frac{2}{3}} \right)^2} + {\left( {\frac{{\sqrt 5 }}{3}} \right)^2}.}$

Changing $$u = t – \large{\frac{2}{3}}\normalsize,$$ $$du = dt$$ gives the final answer:

${I = \frac{2}{3}\int {\frac{{dt}}{{{{\left( {t – \frac{2}{3}} \right)}^2} + {{\left( {\frac{{\sqrt 5 }}{3}} \right)}^2}}}} }={ \frac{2}{3}\int {\frac{{du}}{{{u^2} + {{\left( {\frac{{\sqrt 5 }}{3}} \right)}^2}}}} }={ \frac{2}{3} \cdot \frac{1}{{\frac{{\sqrt 5 }}{3}}}\arctan \frac{u}{{\frac{{\sqrt 5 }}{3}}} + C }={ \frac{2}{{\sqrt 5 }}\arctan \frac{{3\left( {t – \frac{2}{3}} \right)}}{{\sqrt 5 }} + C }={ \frac{2}{{\sqrt 5 }}\arctan \frac{{3t – 2}}{{\sqrt 5 }} + C }={ \frac{2}{{\sqrt 5 }}\arctan \left( {\frac{{3\tan \frac{x}{2} – 2}}{{\sqrt 5 }}} \right) }+{ C.}$

### Example 3.

Calculate the integral $${\large\int\normalsize} {\large\frac{{dx}}{{1 + \cos \frac{x}{2}}}\normalsize}.$$

Solution.

Make the universal trigonometric substitution:

${t = \tan \frac{x}{4},\;\;}\Rightarrow {d\left( {\frac{x}{2}} \right) = \frac{{2dt}}{{1 + {t^2}}},\;\;}\Rightarrow {\cos \frac{x}{2} = \frac{{1 – {t^2}}}{{1 + {t^2}}}.}$

Then the integral becomes

$\require{cancel} {\int {\frac{{dx}}{{1 + \cos \frac{x}{2}}}} } ={ \int {\frac{{d\left( {\frac{x}{2}} \right)}}{{1 + \cos \frac{x}{2}}}} } ={ 2\int {\frac{{\frac{{2dt}}{{1 + {t^2}}}}}{{1 + \frac{{1 – {t^2}}}{{1 + {t^2}}}}}} } ={ 4\int {\frac{{dt}}{{1 + \cancel{t^2} + 1 – \cancel{t^2}}}} } ={ 2\int {dt} } ={ 2t + C } ={ 2\tan \frac{x}{4} + C.}$

### Example 4.

Evaluate the integral $$\int {\large{\frac{{dx}}{{1 + \cos 2x}}}\normalsize}.$$

Solution.

Using the substitution

${t = \tan x,}\;\; \Rightarrow {x = \arctan t,}\;\; \Rightarrow {dx = \frac{{dt}}{{1 + {t^2}}},}\;\; \Rightarrow {\cos 2x = \frac{{1 – {t^2}}}{{1 + {t^2}}},}$

we can easily find the integral:

${\require{cancel}\int {\frac{{dx}}{{1 + \cos 2x}}} }={ \int {\frac{{\frac{{dt}}{{1 + {t^2}}}}}{{1 + \frac{{1 – {t^2}}}{{1 + {t^2}}}}}} }={ \int {\frac{{dt}}{{1 + \cancel{t^2} + 1 – \cancel{t^2}}}} }={ \int {\frac{{dt}}{2}} }={ \frac{t}{2} + C }={ \frac{1}{2}\tan x + C.}$

### Example 5.

Compute the integral $$\int {\large{\frac{{dx}}{{4 + 5\cos \frac{x}{2}}}}\normalsize}.$$

Solution.

To simplify the integral, we use the Weierstrass substitution:

${t = \tan \frac{x}{4},}\;\; \Rightarrow {x = 4\arctan t,\;\;}\kern0pt{dx = \frac{{4dt}}{{1 + {t^2}}},\;\;}\kern0pt{\cos \frac{x}{2} = \frac{{1 – {t^2}}}{{1 + {t^2}}}.}$

The integral becomes

${\int {\frac{{dx}}{{4 + 5\cos \frac{x}{2}}}} }={ \int {\frac{{\frac{{4dt}}{{1 + {t^2}}}}}{{4 + 5 \cdot \frac{{1 – {t^2}}}{{1 + {t^2}}}}}} }={ \int {\frac{{4dt}}{{4\left( {1 + {t^2}} \right) + 5\left( {1 – {t^2}} \right)}}} }={ 4\int {\frac{{dt}}{{4 + 4{t^2} + 5 – 5{t^2}}}} }={ 4\int {\frac{{dt}}{{{3^2} – {t^2}}}} }={ 4 \cdot \frac{1}{{2 \cdot 3}}\ln \left| {\frac{{3 + t}}{{3 – t}}} \right| + C }={ \frac{2}{3}\ln \left| {\frac{{3 + \tan \frac{x}{4}}}{{3 – \tan \frac{x}{4}}}} \right| + C.}$

### Example 6.

Find the integral $${\large\int\normalsize} {\large\frac{{dx}}{{\sin x + \cos x}}\normalsize}.$$

Solution.

As in the previous examples, we will use the universal trigonometric substitution:

${t = \tan \frac{x}{2},\;\;}\Rightarrow {x = 2\arctan t,\;\;\;}\kern-0.3pt {dx = \frac{{2dt}}{{1 + {t^2}}}.}$

Since $$\sin x = {\large\frac{{2t}}{{1 + {t^2}}\normalsize}},$$ $$\cos x = {\large\frac{{1 – {t^2}}}{{1 + {t^2}}\normalsize}},$$ we can write:

${\int {\frac{{dx}}{{\sin x + \cos x}}} } ={ \int {\frac{{\frac{{2dt}}{{1 + {t^2}}}}}{{\frac{{2t}}{{1 + {t^2}}} + \frac{{1 – {t^2}}}{{1 + {t^2}}}}}} } ={ \int {\frac{{2dt}}{{2t + 1 – {t^2}}}} } ={ 2\int {\frac{{dt}}{{1 – \left( {{t^2} – 2t} \right)}}} } ={ 2\int {\frac{{dt}}{{1 – \left( {{t^2} – 2t + 1 – 1} \right)}}} } ={ 2\int {\frac{{dt}}{{2 – {{\left( {t – 1} \right)}^2}}}} } ={ 2\int {\frac{{d\left( {t – 1} \right)}}{{{{\left( {\sqrt 2 } \right)}^2} – {{\left( {t – 1} \right)}^2}}}} } ={{ 2 \cdot}\kern0pt{ \frac{1}{{2\sqrt 2 }}\ln \left| {\frac{{\sqrt 2 + \left( {t – 1} \right)}}{{\sqrt 2 – \left( {t – 1} \right)}}} \right| }+{ C }} ={{ \frac{1}{{\sqrt 2 }}\ln \left| {\frac{{\sqrt 2 – 1 + \tan \frac{x}{2}}}{{\sqrt 2 + 1 – \tan \frac{x}{2}}}} \right| }+{ C.}}$

### Example 7.

Find the integral $$\int {\large{\frac{{dx}}{{\sin x + \cos x + 1}}}\normalsize}.$$

Solution.

Making the $${\tan \large{\frac{x}{2}}\normalsize}$$ substitution, we have

${t = \tan \frac{x}{2},}\;\; \Rightarrow {x = 2\arctan t,\;\;}\kern0pt{dx = \frac{{2dt}}{{1 + {t^2}}},\;\;}\kern0pt{\sin x = \frac{{2t}}{{1 + {t^2}}},\;\;}\kern0pt{\cos x = \frac{{1 – {t^2}}}{{1 + {t^2}}}.}$

Then the integral in $$t-$$terms is written as

${\int {\frac{{dx}}{{\sin x + \cos x + 1}}} }={ \int {\frac{{\frac{{2dt}}{{1 + {t^2}}}}}{{\frac{{2t}}{{1 + {t^2}}} + \frac{{1 – {t^2}}}{{1 + {t^2}}} + 1}}} }={ \int {\frac{{\frac{{2dt}}{{1 + {t^2}}}}}{{\frac{{2t + 1 – {t^2} + 1 + {t^2}}}{{1 + {t^2}}}}}} }={ \int {\frac{{2dt}}{{2t + 2}}} }={ \int {\frac{{dt}}{{t + 1}}} }={ \ln \left| {t + 1} \right| + C }={ \ln \left| {\tan \frac{x}{2} + 1} \right| + C.}$

Page 1
Problems 1-7
Page 2
Problems 8-18