How to Use the Weierstrass Substitution Step by Step with Examples
If you’ve ever encountered a trigonometric integral that seems impossible using trig identities, substitution, or integration by parts, then the Weierstrass substitution might be precisely what you need. Also known as the tangent half-angle substitution, this technique transforms trigonometric integrals into rational functions, allowing you to apply familiar algebraic integration methods. Keep reading to learn how to use the Weierstrass substitution step by step.
The Weierstrass substitution is beneficial when techniques covered in How to Integrate Products of Trigonometric Functions: Techniques and Tricks don’t work. In these cases, expressing sine and cosine in terms of a new variable \( t = \tan(\frac{x}{2}) \) transforms the function into a rational function, which we know how to integrate.
In this guide, we’ll break down the entire process, and walk through a detailed example.
This article is part of a three-part series on advanced substitutions. The following infographic illustrates this topic.
What Is the Weierstrass Substitution?
The Weierstrass substitution, also known as the tangent half-angle substitution, simplifies trigonometric integrals based on the idea that every trigonometric function can be related to the tangent of half an angle. By rewriting trigonometric integrals in this way, complicated trigonometric integrals can be transformed into integrals of rational functions.
In the next section, we’ll outline the step-by-step process for applying the Weierstrass substitution, followed by a fully worked example to show how the method works in practice.
Step-by-Step Procedure for Applying the Weierstrass Substitution
Now that we understand the Weierstrass substitution, let’s look at how to apply it. The idea is to use trigonometric identities and right triangle trigonometry to transform the integrand into a rational function.
Step 1: Use Trigonometric Identities to Rewrite Angles
Before substituting, express everything in terms of half-angles using trigonometric identities. Helpful identities include:
Reciprocal Identities
$$\sec{x} = \frac{1}{\cos{x}}$$
$$\csc{x} = \frac{1}{\sin{x}}$$
Quotient Identities
$$\cot{x} = \frac{\cos{x}}{\sin{x}}$$
Double Angle Identities
$$\sin{2x} = 2\sin{x}\cos{x}$$
$$\cos{2x} = \cos^2{x} – \sin^2{x}$$
$$\cos{2x} = 2\cos^2{x} – 1$$
$$\cos{2x} = 1 – 2\sin^2{x}$$
$$\tan{2x} = \frac{2\tan{x}}{1 – \tan^2{x}}$$
Sum Identities
$$\sin{(x + y)} = \sin{x}\cos{y} + \cos{x}\sin{y}$$
$$\cos{(x + y)} = \cos{x}\cos{y} – \sin{x}\sin{y}$$
$$\tan{(x + y)} = \frac{\tan{x} + \tan{y}}{1 – \tan{x}\tan{y}}$$
Step 2: Apply the Substitution
Let \( t = \tan{\frac{x}{2}} \). Solve for x and differentiate to find the differential. Please refer to the articles How to Differentiate a Function Step by Step: A Beginner’s Guide and The Ultimate Step-by-Step Guide to Solving Integrals Using Substitution for help with the derivative and substitution, respectively.
Step 3: Sketch the Right Triangle
Draw a right triangle where one of the angles is \( \frac{x}{2} \). Using the definition of tangent and the Pythagorean Theorem, express the lengths of the sides in terms of t.
Step 4: Rewrite the Entire Integral in Terms of the New Variable t
Use the right triangle and differential to express everything in terms of t.
Step 5: Integrate
You should now have a rational integral that can be evaluated using polynomial long division, partial fraction decomposition, or completing the square. These techniques are covered How to Integrate Using Polynomial Long Division with Examples, A Comprehensive Beginner’s Guide to Partial Fraction Decomposition, Partial Fraction Decomposition Integration Problems with Solutions: A Complete Tutorial, and The Ultimate Guide on How to Solve Integrals by Completing the Square.
If the integral is simple, you may be able to evaluate it using only the techniques covered in Basic Integration Problems for Beginners.
Step 6: Convert Back to the Original Variable
After integrating, back substitute to convert the result back to the original variable \( x \).
In the next section, we’ll apply this procedure to a complete example to see how these steps fit together in practice.
Worked Out Example
Example 1: Evaluate \( \int \frac{1}{1+\sin x} dx \).
Solution: Using the double-angle identity gives
$$\int \frac{1}{1 + 2\sin{(\frac{x}{2})}\cos{(\frac{x}{2})}} dx.$$
Let \( t = \tan{\frac{x}{2}} \). Solving for x, we get
$$x = 2\arctan{t}.$$
Next, we compute the differential to obtain
$$dx = \frac{2}{t^2 + 1} dt.$$
Shown below is the right triangle for our substitution.
From the triangle and differential, our new integral is
$$\int \frac{1}{1 + 2\frac{t}{\sqrt{t^2 + 1}}\frac{1}{\sqrt{t^2 + 1}}} \frac{2}{t^2 +1}dt.$$
Simplifying we get
$$\int \frac{1}{1 + 2\frac{t}{t^2 + 1}} \frac{2}{t^2 +1}dt.$$
Multiplying we get
$$\int \frac{2}{t^2 + 2t + 1} dt.$$
This is equivalent to
$$\int \frac{2}{(t + 1)^2} dt.$$
Let \( u = t + 1 \), then the differential is \( du = dt \). Substituting into the integral, we obtain
$$\int \frac{2}{u^2} du.$$
Rewriting the integral in terms of negative exponents gives us
$$\int 2u^{-2} du.$$
Integrating, we arrive at
$$-2u^{-1} + C.$$
In terms of positive exponents, this is
$$-\frac{2}{u} + C.$$
Back substituting, we get
$$-\frac{2}{t + 1} + C.$$
Writing everything in terms of x, we arrive at a final answer of
$$-\frac{2}{\tan{(\frac{x}{2})} + 1} + C.$$
Conclusion
The Weierstrass substitution offers a method to convert integrals involving trigonometric functions into rational functions. Throughout this guide, you’ve learned how to use the Weierstrass substitution step by step using trigonometric identities and right triangle trigonometry. This approach gives you a deeper understanding of why the method works rather than just applying formulas.
Further Reading
Examples of Rationalizing Substitution in Calculus: A Beginner-Friendly Guide – Rationalizing substitution is similar to Weierstrass substitution, but applies to integrals containing roots of linear functions.
Euler Substitution Examples with Solutions: A Complete Step-by-Step Beginner’s Guide – Euler substitution is similar to Weierstrass substitution, but applies to integrals containing square roots of quadratics.


