Step-by-step Solution

Solve the trigonometric integral $\int\frac{1}{2\sin\left(x\right)\cos\left(x\right)}dx$

Go!
1
2
3
4
5
6
7
8
9
0
a
b
c
d
f
g
m
n
u
v
w
x
y
z
.
(◻)
+
-
×
◻/◻
/
÷
2

e
π
ln
log
log
lim
d/dx
Dx
|◻|
=
>
<
>=
<=
sin
cos
tan
cot
sec
csc

asin
acos
atan
acot
asec
acsc

sinh
cosh
tanh
coth
sech
csch

asinh
acosh
atanh
acoth
asech
acsch

Final Answer

$\frac{1}{2}\ln\left|\tan\left(\frac{x}{2}\right)\right|-\frac{1}{2}\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|+C_0$

Step-by-step solution

Problem to solve:

$\int\frac{1}{2sin\left(x\right)cos\left(x\right)}dx$

Solving method

1

We can solve the integral $\int\frac{1}{2\sin\left(x\right)\cos\left(x\right)}dx$ by applying the method Weierstrass substitution (also known as tangent half-angle substitution) which converts an integral of trigonometric functions into a rational function of $t$ by setting the substitution

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

Hence

$\sin x=\frac{2t}{1+t^{2}},\:\cos x=\frac{1-t^{2}}{1+t^{2}},\:\mathrm{and}\:\:dx=\frac{2}{1+t^{2}}dt$
3

Substituting in the original integral we get

$\int\frac{1}{2\left(\frac{2t}{1+t^{2}}\right)\left(\frac{1-t^{2}}{1+t^{2}}\right)}\frac{2}{1+t^{2}}dt$

Multiplying fractions $\frac{1}{2\left(\frac{2t}{1+t^{2}}\right)\left(\frac{1-t^{2}}{1+t^{2}}\right)} \times \frac{2}{1+t^{2}}$

$\int\frac{\frac{1}{2}\left(1+t^{2}\right)^2}{t\left(1+t^{2}\right)\left(1-t^{2}\right)}dt$

Simplify the fraction by $1+t^{2}$

$\int\frac{\frac{1}{2}\left(1+t^{2}\right)}{t\left(1-t^{2}\right)}dt$
4

Simplifying

$\int\frac{\frac{1}{2}\left(1+t^{2}\right)}{t\left(1-t^{2}\right)}dt$
5

We can solve the integral $\int\frac{\frac{1}{2}\left(1+t^{2}\right)}{t\left(1-t^{2}\right)}dt$ by applying integration by substitution method (also called U-Substitution). First, we must identify a section within the integral with a new variable (let's call it $u$), which when substituted makes the integral easier. We see that $1+t^{2}$ it's a good candidate for substitution. Let's define a variable $u$ and assign it to the choosen part

$u=1+t^{2}$

Differentiate both sides of the equation $u=1+t^{2}$

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

Find the derivative

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

The derivative of a sum of two functions is the sum of the derivatives of each function

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

The derivative of the constant function ($1$) is equal to zero

$\frac{d}{dt}\left(t^{2}\right)$

The power rule for differentiation states that if $n$ is a real number and $f(x) = x^n$, then $f'(x) = nx^{n-1}$

$2t$
6

Now, in order to rewrite $dt$ in terms of $du$, we need to find the derivative of $u$. We need to calculate $du$, we can do that by deriving the equation above

$du=2tdt$
7

Isolate $dt$ in the previous equation

$\frac{du}{2t}=dt$

We need to isolate the dependent variable $t$, we can do that by subtracting $1$ from both sides of the equation

$t^{2}=u-1$

Removing the variable's exponent

$t=\sqrt{u-1}$
8

Rewriting $t$ in terms of $u$

$t=\sqrt{u-1}$

Divide fractions $\frac{\frac{\frac{1}{2}u}{t\left(1-t^{2}\right)}}{2t}$ with Keep, Change, Flip: $\frac{a}{b}\div c=\frac{a}{b}\div\frac{c}{1}=\frac{a}{b}\times\frac{1}{c}=\frac{a}{b\cdot c}$

$\int\frac{\frac{1}{2}u}{2t^2\left(1-t^{2}\right)}du$

Take $\frac{\frac{1}{2}}{2}$ out of the fraction

$\int\frac{\frac{1}{4}u}{t^2\left(1-t^{2}\right)}du$

Rewriting $t$ in terms of $\sqrt{u-1}$

$\int\frac{\frac{1}{4}u}{\left(\sqrt{u-1}\right)^2\left(1-\left(\sqrt{u-1}\right)^{2}\right)}du$

Cancel exponents $\frac{1}{2}$ and $2$

$\int\frac{\frac{1}{4}u}{\left(u-1\right)\left(1-\left(u-1\right)\right)}du$

Solve the product $-\left(u-1\right)$

$\int\frac{\frac{1}{4}u}{\left(u-1\right)\left(2-u\right)}du$
9

Substituting $u$, $dt$ and $t$ in the integral and simplify

$\int\frac{\frac{1}{4}u}{\left(u-1\right)\left(2-u\right)}du$
10

Take out the constant $\frac{1}{4}$ from the integral

$\frac{1}{4}\int\frac{u}{\left(u-1\right)\left(2-u\right)}du$
11

We can solve the integral $\int\frac{u}{\left(u-1\right)\left(2-u\right)}du$ by applying integration by substitution method (also called U-Substitution). First, we must identify a section within the integral with a new variable (let's call it $v$), which when substituted makes the integral easier. We see that $2-u$ it's a good candidate for substitution. Let's define a variable $v$ and assign it to the choosen part

$v=2-u$

Differentiate both sides of the equation $v=2-u$

$dv=\frac{d}{du}\left(2-u\right)$

Find the derivative

$\frac{d}{du}\left(2-u\right)$

The derivative of a sum of two functions is the sum of the derivatives of each function

$\frac{d}{du}\left(2\right)+\frac{d}{du}\left(-u\right)$

The derivative of the constant function ($2$) is equal to zero

$\frac{d}{du}\left(-u\right)$

The derivative of the linear function times a constant, is equal to the constant

$-1$
12

Now, in order to rewrite $du$ in terms of $dv$, we need to find the derivative of $v$. We need to calculate $dv$, we can do that by deriving the equation above

$dv=-1du$
13

Isolate $du$ in the previous equation

$\frac{dv}{-1}=du$

We need to isolate the dependent variable $u$, we can do that by subtracting $2$ from both sides of the equation

$-u=v-2$

Divide both sides of the equation by $-1$

$u=-\left(v-2\right)$

Solve the product $-\left(v-2\right)$

$u=-v+2$
14

Rewriting $u$ in terms of $v$

$u=-v+2$

Divide fractions $\frac{\frac{u}{v\left(u-1\right)}}{-1}$ with Keep, Change, Flip: $\frac{a}{b}\div c=\frac{a}{b}\div\frac{c}{1}=\frac{a}{b}\times\frac{1}{c}=\frac{a}{b\cdot c}$

$\int\frac{u}{-v\left(u-1\right)}dv$

Rewriting $u$ in terms of $-v+2$

$\int\frac{-v+2}{-v\left(-v+2-1\right)}dv$

Subtract the values $2$ and $-1$

$\int\frac{-v+2}{-v\left(1-v\right)}dv$

Take the constant $\frac{1}{-1}$ out of the integral

$-\int\frac{-v+2}{v\left(1-v\right)}dv$
15

Substituting $v$, $du$ and $u$ in the integral and simplify

$\frac{1}{4}\left(-1\right)\int\frac{-v+2}{v\left(1-v\right)}dv$
16

We can solve the integral $\int\frac{-v+2}{v\left(1-v\right)}dv$ by applying integration by substitution method (also called U-Substitution). First, we must identify a section within the integral with a new variable (let's call it $w$), which when substituted makes the integral easier. We see that $1-v$ it's a good candidate for substitution. Let's define a variable $w$ and assign it to the choosen part

$w=1-v$

Differentiate both sides of the equation $w=1-v$

$dw=\frac{d}{dv}\left(1-v\right)$

Find the derivative

$\frac{d}{dv}\left(1-v\right)$

The derivative of a sum of two functions is the sum of the derivatives of each function

$\frac{d}{dv}\left(1\right)+\frac{d}{dv}\left(-v\right)$

The derivative of the constant function ($1$) is equal to zero

$\frac{d}{dv}\left(-v\right)$

The derivative of the linear function times a constant, is equal to the constant

$-1$
17

Now, in order to rewrite $dv$ in terms of $dw$, we need to find the derivative of $w$. We need to calculate $dw$, we can do that by deriving the equation above

$dw=-1dv$
18

Isolate $dv$ in the previous equation

$\frac{dw}{-1}=dv$

We need to isolate the dependent variable $v$, we can do that by subtracting $1$ from both sides of the equation

$-v=w-1$

Divide both sides of the equation by $-1$

$v=-\left(w-1\right)$

Solve the product $-\left(w-1\right)$

$v=-w+1$
19

Rewriting $v$ in terms of $w$

$v=-w+1$

Divide fractions $\frac{\frac{-v+2}{wv}}{-1}$ with Keep, Change, Flip: $\frac{a}{b}\div c=\frac{a}{b}\div\frac{c}{1}=\frac{a}{b}\times\frac{1}{c}=\frac{a}{b\cdot c}$

$\int\frac{-v+2}{-wv}dw$

Rewriting $v$ in terms of $-w+1$

$\int\frac{-\left(-w+1\right)+2}{-w\left(-w+1\right)}dw$

Solve the product $-\left(-w+1\right)$

$\int\frac{1+w}{-w\left(-w+1\right)}dw$

Take the constant $\frac{1}{-1}$ out of the integral

$-\int\frac{1+w}{w\left(-w+1\right)}dw$
20

Substituting $w$, $dv$ and $v$ in the integral and simplify

$\frac{1}{4}\left(-1\right)\left(-1\right)\int\frac{1+w}{w\left(-w+1\right)}dw$

Multiply $\frac{1}{4}$ times $-1$

$-\frac{1}{4}\left(-1\right)\int\frac{1+w}{w\left(-w+1\right)}dw$

Multiply $-\frac{1}{4}$ times $-1$

$\frac{1}{4}\int\frac{1+w}{w\left(-w+1\right)}dw$
21

Simplifying

$\frac{1}{4}\int\frac{1+w}{w\left(-w+1\right)}dw$
22

Rewrite the fraction $\frac{1+w}{w\left(-w+1\right)}$ in $2$ simpler fractions using partial fraction decomposition

$\frac{1+w}{w\left(-w+1\right)}=\frac{A}{w}+\frac{B}{-w+1}$
23

Find the values for the unknown coefficients: $A, B$. The first step is to multiply both sides of the equation from the previous step by $w\left(-w+1\right)$

$1+w=w\left(-w+1\right)\left(\frac{A}{w}+\frac{B}{-w+1}\right)$
24

Multiplying polynomials

$1+w=\frac{wA\left(-w+1\right)}{w}+\frac{wB\left(-w+1\right)}{-w+1}$
25

Simplifying

$1+w=A\left(-w+1\right)+wB$
26

Expand the polynomial

$1+w=-Aw+A+wB$
27

Assigning values to $w$ we obtain the following system of equations

$\begin{matrix}1=A&\:\:\:\:\:\:\:(w=0) \\ 0=2A-B&\:\:\:\:\:\:\:(w=-1)\end{matrix}$
28

Proceed to solve the system of linear equations

$\begin{matrix}1A & + & 0B & =1 \\ 2A & - & 1B & =0\end{matrix}$
29

Rewrite as a coefficient matrix

$\left(\begin{matrix}1 & 0 & 1 \\ 2 & -1 & 0\end{matrix}\right)$
30

Reducing the original matrix to a identity matrix using Gaussian Elimination

$\left(\begin{matrix}1 & 0 & 1 \\ 0 & 1 & 2\end{matrix}\right)$
31

The integral of $\frac{1+w}{w\left(-w+1\right)}$ in decomposed fraction equals

$\frac{1}{4}\int\left(\frac{1}{w}+\frac{2}{-w+1}\right)dw$
32

Expand the integral $\int\left(\frac{1}{w}+\frac{2}{-w+1}\right)dw$

$\frac{1}{4}\left(\int\frac{1}{w}dw+\int\frac{2}{-w+1}dw\right)$

$\frac{1}{4}\left(\int\frac{1}{w}dw+\frac{2}{-1}\ln\left|-w+1\right|\right)$

Divide $2$ by $-1$

$\frac{1}{4}\left(\int\frac{1}{w}dw-2\ln\left|-w+1\right|\right)$
33

Apply the formula: $\int\frac{n}{ax+b}dx$$=\frac{n}{a}\ln\left|ax+b\right|$, where $a=-1$, $b=1$, $x=w$ and $n=2$

$\frac{1}{4}\left(\int\frac{1}{w}dw-2\ln\left|-w+1\right|\right)$

$\frac{1}{4}\left(1\ln\left|w\right|-2\ln\left|-w+1\right|\right)$

Any expression multiplied by $1$ is equal to itself

$\frac{1}{4}\left(\ln\left|w\right|-2\ln\left|-w+1\right|\right)$
34

The integral of the inverse of the lineal function is given by the following formula, $\displaystyle\int\frac{1}{x}dx=\ln(x)$

$\frac{1}{4}\left(\ln\left|w\right|-2\ln\left|-w+1\right|\right)$

$\frac{1}{4}\left(\ln\left|1-v\right|-2\ln\left|-\left(1-v\right)+1\right|\right)$
35

Replace $w$ with the value that we assigned to it in the beginning: $1-v$

$\frac{1}{4}\left(\ln\left|1-v\right|-2\ln\left|-\left(1-v\right)+1\right|\right)$
36

Solve the product $-(1-v)$

$\frac{1}{4}\left(\ln\left|1-v\right|-2\ln\left|v\right|\right)$

$\frac{1}{4}\left(\ln\left|1-\left(2-u\right)\right|-2\ln\left|2-u\right|\right)$
37

Replace $v$ with the value that we assigned to it in the beginning: $2-u$

$\frac{1}{4}\left(\ln\left|1-\left(2-u\right)\right|-2\ln\left|2-u\right|\right)$
38

Solve the product $-(2-u)$

$\frac{1}{4}\left(\ln\left|-1+u\right|-2\ln\left|2-u\right|\right)$

$\frac{1}{4}\left(\ln\left|-1+1+t^{2}\right|-2\ln\left|2-\left(1+t^{2}\right)\right|\right)$

Subtract the values $1$ and $-1$

$\frac{1}{4}\left(\ln\left|0+t^{2}\right|-2\ln\left|2-\left(1+t^{2}\right)\right|\right)$

$x+0=x$, where $x$ is any expression

$\frac{1}{4}\left(\ln\left|t^{2}\right|-2\ln\left|2-\left(1+t^{2}\right)\right|\right)$
39

Replace $u$ with the value that we assigned to it in the beginning: $1+t^{2}$

$\frac{1}{4}\left(\ln\left|t^{2}\right|-2\ln\left|2-\left(1+t^{2}\right)\right|\right)$
40

Solve the product $-(1+t^{2})$

$\frac{1}{4}\left(\ln\left|t^{2}\right|-2\ln\left|1-t^{2}\right|\right)$
41

Replace $t$ with the value that we assigned to it in the beginning: $\tan\left(\frac{x}{2}\right)$

$\frac{1}{4}\left(\ln\left|\tan\left(\frac{x}{2}\right)^{2}\right|-2\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|\right)$
42

As the integral that we are solving is an indefinite integral, when we finish integrating we must add the constant of integration $C$

$\frac{1}{4}\left(\ln\left|\tan\left(\frac{x}{2}\right)^{2}\right|-2\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|\right)+C_0$
43

Simplify $\ln\left|\tan\left(\frac{x}{2}\right)^{2}\right|$ by applying logarithm properties

$\frac{1}{4}\left(2\ln\left|\tan\left(\frac{x}{2}\right)\right|-2\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|\right)+C_0$

$\frac{1}{2}\cdot 1+\frac{1}{2}t^{2}$

Multiply $\frac{1}{2}$ times $1$

$\frac{1}{2}+\frac{1}{2}t^{2}$

$\frac{1}{2}\cdot 1+\frac{1}{2}t^{2}$

Multiply $\frac{1}{2}$ times $1$

$\frac{1}{2}+\frac{1}{2}t^{2}$

$\frac{1}{2}\cdot 1+\frac{1}{2}t^{2}$

Multiply $\frac{1}{2}$ times $1$

$\frac{1}{2}+\frac{1}{2}t^{2}$

$\frac{1}{2}\cdot 1+\frac{1}{2}t^{2}$

Multiply $\frac{1}{2}$ times $1$

$\frac{1}{2}+\frac{1}{2}t^{2}$

$\frac{1}{2}\cdot 1+\frac{1}{2}t^{2}$

Multiply $\frac{1}{2}$ times $1$

$\frac{1}{2}+\frac{1}{2}t^{2}$

$\frac{1}{2}\cdot 1+\frac{1}{2}t^{2}$

Multiply $\frac{1}{2}$ times $1$

$\frac{1}{2}+\frac{1}{2}t^{2}$

$\frac{1}{4}\cdot 2\ln\left|\tan\left(\frac{x}{2}\right)\right|+\frac{1}{4}\cdot -2\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|+C_0$

Multiply $\frac{1}{4}$ times $2$

$\frac{1}{2}\ln\left|\tan\left(\frac{x}{2}\right)\right|+\frac{1}{4}\cdot -2\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|+C_0$

Multiply $\frac{1}{4}$ times $-2$

$\frac{1}{2}\ln\left|\tan\left(\frac{x}{2}\right)\right|-\frac{1}{2}\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|+C_0$
44

Solve the product $\frac{1}{4}\left(2\ln\left|\tan\left(\frac{x}{2}\right)\right|-2\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|\right)$

$\frac{1}{2}\ln\left|\tan\left(\frac{x}{2}\right)\right|-\frac{1}{2}\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|+C_0$

Final Answer

$\frac{1}{2}\ln\left|\tan\left(\frac{x}{2}\right)\right|-\frac{1}{2}\ln\left|1-\tan\left(\frac{x}{2}\right)^{2}\right|+C_0$