0

Here's how I solved it. \begin{eqnarray*} & & \int_{0}^{\pi}\sqrt{1+\left(4\sin^{2}\left(\frac{x}{2}\right)\right)-\left(4\sin\left(\frac{x}{2}\right)\right)}\mathrm{d}x\\ & = & \int_{0}^{\pi}\sqrt{4\left(\sin^{2}\left(\frac{x}{2}\right)-\sin\left(\frac{x}{2}\right)+\frac{1}{4}\right)}\mathrm{d}x\\ & = & 2\int_{0}^{\pi}\sqrt{\left(\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right)^{2}}\mathrm{d}x\\ & = & 2\int_{0}^{\pi}\left(\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right)\mathrm{d}x\\ & = & 2\left(\frac{-\cos\left(\frac{x}{2}\right)}{\frac{1}{2}}-\frac{x}{2}\right)_{0}^{\pi}\\ & = & 2\left(\left(\frac{-\cos\left(\frac{\pi}{2}\right)}{\frac{1}{2}}-\frac{\pi}{2}\right)-\left(\frac{-\cos\left(\frac{0}{2}\right)}{\frac{1}{2}}-\frac{0}{2}\right)\right)\\ & = & 2\left(\left(0-\frac{\pi}{2}\right)-\left(\frac{-1}{\frac{1}{2}}-0\right)\right)\\ & = & 2\left(-\frac{\pi}{2}+2\right)\\ & = & 4-\pi\\ & \approx & 0.858407 \end{eqnarray*}

However, Wolfram Alpha gives the answer $1.88101$ Where did I go wrong?

user80551
  • 569

3 Answers3

1

Your third equality sign: you forgot that $\sqrt{x^{2}}=|x|$. Therefore, you should take an absolute value and then split the integral into positive and negative part.

The $\sin (x/2)-1/2$ function changes the sign between $0$ and $\pi$.

GregVoit
  • 508
1

Your error is that : $$\int_{0}^{\pi}\sqrt{\left(\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right)^{2}}\mathrm{d}x \neq \int_{0}^{\pi}\left(\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right)\mathrm{d}x \\$$ but instead : \begin{align}\int_{0}^{\pi}\sqrt{\left(\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right)^{2}}\mathrm{d}x & = \int_{0}^{\pi}\left|\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right|\mathrm{d}x\\ & = \int_{0}^{\frac{\pi}{3}}\left(\frac{1}{2}-\sin\left(\frac{x}{2}\right)\right)\mathrm{d}x +\int_{\frac{\pi}{3}}^{\pi}\left(\sin\left(\frac{x}{2}\right)-\frac{1}{2}\right)\mathrm{d}x \end{align} because $\sin(\frac{x}{2})-\frac{1}{2}$ is negative for $x$ between $0$ and $\pi/3$ and positive for $x$ between $\pi/3$ and $\pi$ (you can easily check this with WolframAlpha).
Then, multipling by $2$ the previous expression you get $1.88101$

Also, a general advice if you want to find where your error is in a calculation like the previous one, compute each step of your calculation with, for example, WolframAlpha and at the step where the result changes you know that it's at this step that you've made an error.

KoObO
  • 33
0

You lost the modulus, when you erase the square root within the integral.