# Question 3cbbc

${\int}_{0}^{\frac{\pi}{4}} \frac{\sin x + \cos x}{3 + \sin 2 x} \mathrm{dx} = 0.2746530521$

#### Explanation:

My solution is by Simpson's Rule, the Approximation Formula

${\int}_{a}^{b} y \cdot \mathrm{dx} \cong$
$\frac{h}{3} \left({y}_{0} + 4 \cdot {y}_{1} + 2 \cdot {y}_{2} + 4 \cdot {y}_{3} + 2 \cdot {y}_{4} + \ldots . . + 4 \cdot {y}_{n - 1} + {y}_{n}\right)$

Where $h = \frac{b - a}{n}$ and $b$ the upper limit and $a$ the lower limit
and $n$ any even number (the larger the better)

I chose
$n = 20$
given $b = \frac{\pi}{4}$ and $a = 0$
$h = \frac{\frac{\pi}{4} - 0}{20} = \frac{\pi}{80}$

This is how to compute. Each $y = \frac{\sin x + \cos x}{3 + \sin 2 x}$ will use different value

for ${y}_{0}$
${x}_{0} = \left(a + 0 \cdot h\right) = \left(0 + 0 \cdot \frac{\pi}{80}\right) = 0$

${y}_{0} = \frac{\sin {x}_{0} + \cos {x}_{0}}{3 + \sin 2 {x}_{0}}$
${y}_{0} = \frac{\sin \left(0\right) + \cos \left(0\right)}{3 + \sin 2 \left(0\right)}$
$\textcolor{red}{{y}_{0} = 0.3333333333333}$

for $4 \cdot {y}_{1}$
${x}_{1} = \left(a + 1 \cdot h\right) = \left(0 + 1 \cdot \frac{\pi}{80}\right) = \frac{\pi}{80}$

$4 \cdot {y}_{1} = 4 \cdot \frac{\sin {x}_{1} + \cos {x}_{1}}{3 + \sin 2 {x}_{1}}$
$4 \cdot {y}_{1} = 4 \cdot \frac{\sin \left(\frac{\pi}{80}\right) + \cos \left(\frac{\pi}{80}\right)}{3 + \sin \left(2 \left(\frac{\pi}{80}\right)\right)}$
$\textcolor{red}{4 \cdot {y}_{1} = 1.3493618978936}$

for $2 \cdot {y}_{2}$
${x}_{2} = \left(a + 2 \cdot h\right) = \left(0 + 2 \cdot \frac{\pi}{80}\right) = 2 \cdot \frac{\pi}{80}$

$2 \cdot {y}_{2} = 2 \cdot \frac{\sin {x}_{2} + \cos {x}_{2}}{3 + \sin 2 {x}_{2}}$
$2 \cdot {y}_{2} = 2 \cdot \frac{\sin \left(\frac{2 \pi}{80}\right) + \cos \left(\frac{2 \pi}{80}\right)}{3 + \sin 2 \left(\frac{2 \pi}{80}\right)}$
$\textcolor{red}{2 \cdot {y}_{2} = 0.68138682514816}$

for $4 \cdot {y}_{3}$
${x}_{3} = \left(a + 3 \cdot h\right) = \left(0 + 3 \cdot \frac{\pi}{80}\right) = 3 \cdot \frac{\pi}{80}$

$4 \cdot {y}_{3} = 4 \cdot \frac{\sin {x}_{3} + \cos {x}_{3}}{3 + \sin 2 {x}_{3}}$
$4 \cdot {y}_{3} = 4 \cdot \frac{\sin \left(\frac{3 \pi}{80}\right) + \cos \left(\frac{3 \pi}{80}\right)}{3 + \sin 2 \left(\frac{3 \pi}{80}\right)}$
$\textcolor{red}{4 \cdot {y}_{3} = 1.3738977832468}$

for $2 \cdot {y}_{4}$
${x}_{4} = \left(a + 4 \cdot h\right) = \left(0 + 4 \cdot \frac{\pi}{80}\right) = 4 \cdot \frac{\pi}{80}$

$2 \cdot {y}_{4} = 4 \cdot \frac{\sin {x}_{4} + \cos {x}_{4}}{3 + \sin 2 {x}_{4}}$
$2 \cdot {y}_{4} = 4 \cdot \frac{\sin \left(\frac{4 \pi}{80}\right) + \cos \left(\frac{4 \pi}{80}\right)}{3 + \sin 2 \left(\frac{4 \pi}{80}\right)}$
$\textcolor{red}{2 \cdot {y}_{4} = 0.69151824096418}$

the rest are as follows
$\textcolor{red}{4 \cdot {y}_{5} = 1.3904648494964}$
$\textcolor{red}{2 \cdot {y}_{6} = 0.69821575035862}$
$\textcolor{red}{4 \cdot {y}_{7} = 1.4011596185484}$
$\textcolor{red}{2 \cdot {y}_{8} = 0.70242415421322}$
$\textcolor{red}{4 \cdot {y}_{9} = 1.4076741205702}$
$\textcolor{red}{2 \cdot {y}_{10} = 0.70489632049832}$
$\textcolor{red}{4 \cdot {y}_{11} = 1.4113400771087}$
$\textcolor{red}{2 \cdot {y}_{12} = 0.7062173920012}$
$\textcolor{red}{4 \cdot {y}_{13} = 1.4131786935757}$
$\textcolor{red}{2 \cdot {y}_{14} = 0.7068293103707}$
$\textcolor{red}{4 \cdot {y}_{15} = 1.4139474301694}$
$\textcolor{red}{2 \cdot {y}_{16} = 0.70705252678954}$
$\textcolor{red}{4 \cdot {y}_{17} = 1.414179352209}$
$\textcolor{red}{2 \cdot {y}_{18} = 0.70710341105534}$
$\textcolor{red}{4 \cdot {y}_{19} = 1.4142131417552}$
$\textcolor{red}{{y}_{20} = 0.35355339059328}$

The sum of all these $\textcolor{red}{\text{sum} = 20.98194762}$

${\int}_{0}^{\frac{\pi}{4}} \frac{\sin x + \cos x}{3 + \sin 2 x} \mathrm{dx} = \left(\frac{h}{3}\right) \cdot \text{sum}$

${\int}_{0}^{\frac{\pi}{4}} \frac{\sin x + \cos x}{3 + \sin 2 x} \mathrm{dx} = \left(\frac{\frac{\pi}{80}}{3}\right) \cdot 20.98194762$
${\int}_{0}^{\frac{\pi}{4}} \frac{\sin x + \cos x}{3 + \sin 2 x} \mathrm{dx} = \textcolor{red}{0.2746530521}$

An alternative is to simply use a graphics calculator during when complicated integration arises with a more accurate value
$\textcolor{red}{= 0.2746530722}$

God bless...I hope the explanation is useful.

May 9, 2016

${\int}_{0}^{\frac{\pi}{4}} \frac{\sin \left(x\right) + \cos \left(x\right)}{3 + \sin \left(2 x\right)} \mathrm{dx} = \ln \frac{3}{4}$

#### Explanation:

We will proceed by using substitution. First, we will go through some algebra to get the integrand into a more desirable form.

$3 + \sin \left(2 x\right) = 3 + 2 \sin \left(x\right) \cos \left(x\right)$

$= 4 + 2 \sin \left(x\right) \cos \left(x\right) - 1$

$= 4 + 2 \sin \left(x\right) \cos \left(x\right) - {\sin}^{2} \left(x\right) - {\cos}^{2} \left(x\right)$

$= 4 - {\left(\sin \left(x\right) - \cos \left(x\right)\right)}^{2}$

$= \left(2 + \sin \left(x\right) - \cos \left(x\right)\right) \left(2 - \sin \left(x\right) + \cos \left(x\right)\right)$

$\implies \frac{\sin \left(x\right) + \cos \left(x\right)}{3 + \sin \left(2 x\right)} = \frac{\sin \left(x\right) + \cos \left(x\right)}{\left(2 + \sin \left(x\right) - \cos \left(x\right)\right) \left(2 - \sin \left(x\right) + \cos \left(x\right)\right)}$

=(4(sin(x)+cos(x)))/(4(2+sin(x)-cos(x))(2-sin(x)+cos(x))#

$= \frac{\sin \left(x\right) + \cos \left(x\right)}{4} \times$
$\times \frac{4}{\left(2 + \sin \left(x\right) - \cos \left(x\right)\right) \left(2 - \sin \left(x\right) + \cos \left(x\right)\right)}$

$= \frac{\sin \left(x\right) + \cos \left(x\right)}{4} \times$
$\times \left(\frac{1}{2 + \sin \left(x\right) - \cos \left(x\right)} + \frac{1}{2 - \sin \left(x\right) + \cos \left(x\right)}\right)$

$= \frac{1}{4} \times \frac{\sin \left(x\right) + \cos \left(x\right)}{2 + \sin \left(x\right) - \cos \left(x\right)} - \frac{1}{4} \times \frac{- \sin \left(x\right) - \cos \left(x\right)}{2 - \sin \left(x\right) + \cos \left(x\right)}$

Using that, we can split the integral:

${\int}_{0}^{\frac{\pi}{4}} \frac{\sin \left(x\right) + \cos \left(x\right)}{3 + \sin \left(2 x\right)} \mathrm{dx} =$

$= \frac{1}{4} {\int}_{0}^{\frac{\pi}{4}} \frac{\sin \left(x\right) + \cos \left(x\right)}{2 + \sin \left(x\right) - \cos \left(x\right)} \mathrm{dx}$

$- \frac{1}{4} {\int}_{0}^{\frac{\pi}{4}} \frac{- \sin \left(x\right) - \cos \left(x\right)}{2 - \sin \left(x\right) + \cos \left(x\right)} \mathrm{dx}$

For the first integral, using the substitution $u = 2 + \sin \left(x\right) - \cos \left(x\right)$ gives us $\mathrm{du} = \left(\sin \left(x\right) + \cos \left(x\right)\right) \mathrm{dx}$ and the bounds of integration change from $0$ and $\frac{\pi}{4}$ to $1$ and $2$. Thus, we get

$\frac{1}{4} {\int}_{0}^{\frac{\pi}{4}} \frac{\sin \left(x\right) + \cos \left(x\right)}{2 + \sin \left(x\right) - \cos \left(x\right)} \mathrm{dx} = {\int}_{1}^{2} \frac{1}{u} \mathrm{du}$

$= \frac{1}{4} {\left(\ln | u |\right)}_{1}^{2}$

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

$= \frac{1}{4} \ln \left(2\right)$

For the second integral, using the substitution $u = 2 - \sin \left(x\right) + \cos \left(x\right)$ gives us $\mathrm{du} = \left(- \sin \left(x\right) - \cos \left(x\right)\right) \mathrm{dx}$ and the bounds of integration change from $0$ and $\frac{\pi}{4}$ to $3$ and $2$. Thus, we get

$- \frac{1}{4} {\int}_{0}^{\frac{\pi}{4}} \frac{- \sin \left(x\right) - \cos \left(x\right)}{2 - \sin \left(x\right) + \cos \left(x\right)} \mathrm{dx} = - \frac{1}{4} {\int}_{3}^{2} \frac{1}{u} \mathrm{du}$

$= \frac{1}{4} {\int}_{2}^{3} \frac{1}{u} \mathrm{du}$

$= \frac{1}{4} \left(\ln \left(3\right) - \ln \left(2\right)\right)$

$= \frac{1}{4} \left(\ln \left(\frac{3}{2}\right)\right)$

Substituting the values in for the integrals gives us our desired result:

${\int}_{0}^{\frac{\pi}{4}} \frac{\sin \left(x\right) + \cos \left(x\right)}{3 + \sin \left(2 x\right)} \mathrm{dx} = \frac{1}{4} \ln \left(2\right) + \frac{1}{4} \ln \left(\frac{3}{2}\right)$

$= \frac{1}{4} \left(\ln \left(2\right) + \ln \left(\frac{3}{2}\right)\right)$

$= \frac{1}{4} \ln \left(2 \cdot \frac{3}{2}\right)$

$= \ln \frac{3}{4}$