Solveeit Logo

Question

Question: How do you find the integral of \(\int{{{\tan }^{n}}xdx}\) if n is an integer?...

How do you find the integral of tannxdx\int{{{\tan }^{n}}xdx} if n is an integer?

Explanation

Solution

We try to form the integral in its recurring form of power. The power reduces by 2 in every integral. We use the identity for tan2x=sec2x1{{\tan }^{2}}x={{\sec }^{2}}x-1. For even and odd value of n the end of the integral differs.

Complete step by step answer:
It’s given that n is an integer. This means nZn\in \mathbb{Z}.
We need to find the value of tannxdx\int{{{\tan }^{n}}xdx}. Let’s assume In=tannxdx{{I}_{n}}=\int{{{\tan }^{n}}xdx}.
We take the trigonometric identity tan2x=sec2x1{{\tan }^{2}}x={{\sec }^{2}}x-1.
We break the power of n in (n2)\left( n-2 \right) and 2.
We get tannx=tann2x.tan2x{{\tan }^{n}}x={{\tan }^{n-2}}x.{{\tan }^{2}}x. We replace the value of tan2x{{\tan }^{2}}x.
Therefore, tannx=tann2x(sec2x1)=tann2xsec2xtann2x{{\tan }^{n}}x={{\tan }^{n-2}}x\left( {{\sec }^{2}}x-1 \right)={{\tan }^{n-2}}x{{\sec }^{2}}x-{{\tan }^{n-2}}x.
Therefore, In=tannxdx=tann2xsec2xdxtann2xdx{{I}_{n}}=\int{{{\tan }^{n}}xdx}=\int{{{\tan }^{n-2}}x{{\sec }^{2}}xdx}-\int{{{\tan }^{n-2}}xdx}.
Now as In=tannxdx{{I}_{n}}=\int{{{\tan }^{n}}xdx}, we can say tann2xdx=In2\int{{{\tan }^{n-2}}xdx}={{I}_{n-2}}.
Now we find the integral value of tann2xsec2xdx\int{{{\tan }^{n-2}}x{{\sec }^{2}}xdx}. We take tanx=z\tan x=z.
Differentiating both sides of the equation of tanx=z\tan x=z, we get
ddx(tanx)=ddx(z) sec2x=dzdx sec2xdx=dz \begin{aligned} & \dfrac{d}{dx}\left( \tan x \right)=\dfrac{d}{dx}\left( z \right) \\\ & \Rightarrow {{\sec }^{2}}x=\dfrac{dz}{dx} \\\ & \Rightarrow {{\sec }^{2}}xdx=dz \\\ \end{aligned}
Now we replace the values of the integral tann2xsec2xdx\int{{{\tan }^{n-2}}x{{\sec }^{2}}xdx} and get
tann2xsec2xdx=(tanx)n2(sec2xdx)=zn2dz\int{{{\tan }^{n-2}}x{{\sec }^{2}}xdx}=\int{{{\left( \tan x \right)}^{n-2}}\left( {{\sec }^{2}}xdx \right)}=\int{{{z}^{n-2}}dz}.
We know that the integral of nth{{n}^{th}} power of x is xndx=xn+1n+1+c\int{{{x}^{n}}dx}=\dfrac{{{x}^{n+1}}}{n+1}+c.
Therefore, zn2dz=zn2+1n2+1+c=zn1n1+c\int{{{z}^{n-2}}dz}=\dfrac{{{z}^{n-2+1}}}{n-2+1}+c=\dfrac{{{z}^{n-1}}}{n-1}+c.
We replace the value of z and get tann2xsec2xdx=tann1xn1+c\int{{{\tan }^{n-2}}x{{\sec }^{2}}xdx}=\dfrac{{{\tan }^{n-1}}x}{n-1}+c.
So, the total integral In=tannxdx=tann2xsec2xdxtann2xdx{{I}_{n}}=\int{{{\tan }^{n}}xdx}=\int{{{\tan }^{n-2}}x{{\sec }^{2}}xdx}-\int{{{\tan }^{n-2}}xdx} becomes
In=tannxdx=tann1xn1In2+c{{I}_{n}}=\int{{{\tan }^{n}}xdx}=\dfrac{{{\tan }^{n-1}}x}{n-1}-{{I}_{n-2}}+c
Now we can see the integral power of ratio tan reducing in every integral by 2.
Therefore, the final integral solution is dependent on the value of n.
The next step of the integral is the In2{{I}_{n-2}}. Replacing value of (n2)\left( n-2 \right) in the value of n, we get
In2=tann2xdx=tann3xn3In4+c{{I}_{n-2}}=\int{{{\tan }^{n-2}}xdx}=\dfrac{{{\tan }^{n-3}}x}{n-3}-{{I}_{n-4}}+c.
Now replacing value of In2{{I}_{n-2}} in In{{I}_{n}}, we get In=tann1xn1(tann3xn3In4)+c=tann1xn1tann3xn3+In4+c{{I}_{n}}=\dfrac{{{\tan }^{n-1}}x}{n-1}-\left( \dfrac{{{\tan }^{n-3}}x}{n-3}-{{I}_{n-4}} \right)+c=\dfrac{{{\tan }^{n-1}}x}{n-1}-\dfrac{{{\tan }^{n-3}}x}{n-3}+{{I}_{n-4}}+c.
We can see the sign is changing in rotation as plus then minus and then plus.
So, for value of n being even the integral value is
In=tann1xn1tann3xn3+....+tanx+(1)n2x+c{{I}_{n}}=\dfrac{{{\tan }^{n-1}}x}{n-1}-\dfrac{{{\tan }^{n-3}}x}{n-3}+....+\tan x+{{\left( -1 \right)}^{\dfrac{n}{2}}}x+c.
For value of n being odd the integral value is
In=tann1xn1tann3xn3+....+tan2x2+(1)n12logsecx+c{{I}_{n}}=\dfrac{{{\tan }^{n-1}}x}{n-1}-\dfrac{{{\tan }^{n-3}}x}{n-3}+....+\dfrac{{{\tan }^{2}}x}{2}+{{\left( -1 \right)}^{\dfrac{n-1}{2}}}\log \left| \sec x \right|+c.

Note: The constant in the integral has been kept at c at all the time. We are taking the final constant as c. Changing the constant all the time would have been difficult to operate. Also we need to remember instead of using the final formula we should always use the step by step integral to avoid the confusion of signs.