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|2-\sec\left(\frac{x}{2}\right)^2\right|+C_0$

Step-by-step explanation

Problem to solve:

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

Choose the 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$
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}$
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$
8

Rewriting $t$ in terms of $u$

$t=\sqrt{u-1}$
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

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

$\frac{\frac{1}{4}u}{\left(u-1\right)\left(2-u\right)}=\frac{A}{u-1}+\frac{B}{2-u}$
11

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 $\left(u-1\right)\left(2-u\right)$

$\frac{1}{4}u=\left(u-1\right)\left(2-u\right)\left(\frac{A}{u-1}+\frac{B}{2-u}\right)$
12

Multiplying polynomials

$\frac{1}{4}u=\frac{A\left(u-1\right)\left(2-u\right)}{u-1}+\frac{B\left(u-1\right)\left(2-u\right)}{2-u}$
13

Simplifying

$\frac{1}{4}u=A\left(2-u\right)+B\left(u-1\right)$
14

Expand the polynomial

$\frac{1}{4}u=2A-Au+Bu-B$
15

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

$\begin{matrix}\frac{1}{4}=A&\:\:\:\:\:\:\:(u=1) \\ -\frac{1}{4}=3A-2B&\:\:\:\:\:\:\:(u=-1)\end{matrix}$
16

Proceed to solve the system of linear equations

$\begin{matrix}1A & + & 0B & =\frac{1}{4} \\ 3A & - & 2B & =-\frac{1}{4}\end{matrix}$
17

Rewrite as a coefficient matrix

$\left(\begin{matrix}1 & 0 & \frac{1}{4} \\ 3 & -2 & -\frac{1}{4}\end{matrix}\right)$
18

Reducing the original matrix to a identity matrix using Gaussian Elimination

$\left(\begin{matrix}1 & 0 & \frac{1}{4} \\ 0 & 1 & \frac{1}{2}\end{matrix}\right)$
19

The integral of $\frac{\frac{1}{4}u}{\left(u-1\right)\left(2-u\right)}$ in decomposed fraction equals

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

The integral of the sum of two or more functions is equal to the sum of their integrals

$\int\frac{\frac{1}{4}}{u-1}du+\int\frac{\frac{1}{2}}{2-u}du$
21

We can solve the integral $\int\frac{\frac{1}{4}}{u-1}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 $u-1$ it's a good candidate for substitution. Let's define a variable $v$ and assign it to the choosen part

$v=u-1$
22

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=du$
23

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

$\int\frac{\frac{1}{4}}{v}dv+\int\frac{\frac{1}{2}}{2-u}du$
24

The integral $\int\frac{\frac{1}{4}}{v}dv$ results in: $\frac{1}{2}\ln\left(t\right)$

$\frac{1}{2}\ln\left(t\right)$
25

The integral $\int\frac{\frac{1}{2}}{2-u}du$ results in: $-\frac{1}{2}\ln\left|2-\left(1+t^{2}\right)\right|$

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

Gather the results of all integrals

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

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

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

Applying the trigonometric identity: $\tan(x)^2+1=\sec(x)^2$

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

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}{2}\ln\left(\tan\left(\frac{x}{2}\right)\right)-\frac{1}{2}\ln\left|2-\sec\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|2-\sec\left(\frac{x}{2}\right)^2\right|+C_0$