2

I'm having trouble solving this problem. So I got that $\sqrt {1 + 2\sin(x)\cos(x)} = \sqrt{(\sin(x) + \cos(x))^2}$ using the Pythagorean Identity for 1, but then I get $\lvert \sin(x) + \cos(x) \rvert$ under the integral sign, and I don't know what to do from here. If I go to the integral calculator (https://www.integral-calculator.com/), it just gives $\sin(x) - \cos(x)$ + C.

Could someone please help?

Arturo Magidin
  • 398,050
  • If you insist on going with $|\sin x + \cos x|$, you can just type that into the calculator. I know from experience that the calculator you mentioned would give you a result. – Accelerator Oct 27 '23 at 01:56
  • Have you tried using the definition of absolute value to see how you might express this without using absolute value and go from there? – AlgTop1854 Oct 27 '23 at 02:04
  • There was a question about it, but it is hard to find, where you got similar result for $\int\sqrt{1+\sin(t)}dt$ – Тyma Gaidash Oct 27 '23 at 02:14
  • @AlgTop1854 I mean, I guess I could use a piecewise function or something. But then why does the integral calculator give sin(x) - cos(x) + C? – Jonah George Oct 27 '23 at 02:51
  • @Accelerator thanks, this does give a different value and I can see the steps, but shouldn't the original integral give the same result? I get $-\dfrac{\cos\left(2x\right)}{\left|\sin\left(x\right)+\cos\left(x\right)\right|}$ – Jonah George Oct 27 '23 at 02:52
  • Using $cos(2x)=cos^2x-sin^2x$ then factoring and dividing gives $\pm(cos( x) - sin( x))$ which is your original solution, but I'm using the $\pm$ because the parity matters due to the absolute value. So I come back to using the piecewise view of this. Try graphing $sin(x)+cos(x)$ then $|sin(x)+cos(x)|$ e.g. in Desmos. – AlgTop1854 Oct 27 '23 at 02:55
  • It's possible to solve an indefinite integral in various ways and get answers that look different, but the constant of integration would make the "different answers" agree. More details here. You could also differentiate your answer and see if you get the original integrand back. – Accelerator Oct 27 '23 at 02:59
  • @JonahGeorge, I guess you possibly can apply Taylor series for $sin(x)+cos(x)$ in this case. – Tran Khanh Oct 27 '23 at 07:50

2 Answers2

1

$$\int{|\sin(x)+ \cos (x)|} \,\mathrm dx= \begin{cases} -\cos(x) +\sin(x) +C_1, & \text{if }\sin(x)+ \cos (x) > 0 \\ \cos(x) -\sin(x) + C_2, & \text{if }\sin(x)+ \cos (x)<0 \end{cases}$$ we need a function $$ f(x) = \begin{cases} 1, & \text{if $\sin(x)+ \cos (x) > 0$ } \\ -1, & \text{if $\sin(x)+ \cos (x)<0$} \end{cases} $$ So $$f(x):= \begin{cases} 0, & \text{if $x=k\pi -\frac{\pi}{4}$ for any integer $k$ } \\ \frac{\sin(x)+ \cos (x)}{|\sin(x)+ \cos (x)|}, & \text{otherwise} \end{cases} $$ This gives $$\int{|\sin(x)+ \cos (x)|} \,\mathrm dx = (-\cos(x) +\sin(x))f(x) +C $$

btw there is a function that behave like $f(x)$ which is $\operatorname{sgn}(x)$.

$$\operatorname{sgn}(x):= \begin{cases} 0, & \text{if $x=0$ } \\ \frac{x}{|x|}, & \text{otherwise } \end{cases}$$

then $f(x)=\operatorname{sgn}(\sin(x)+ \cos (x))$ so the antiderivative is $$ (-\cos(x) +\sin(x))\operatorname{sgn}(\sin(x)+ \cos (x))+C. $$

pie
  • 4,192
-3

$$1+2\sin(x)\cos(x)=\sin^2(x)+\cos^2(x)+2\sin(x)\cos(x)=(\sin(x)+\cos(x))^2$$ HENCE $$∫\sqrt{1+2\sin(x)\cos(x)}dx=∫\sqrt{(\sin(x)+\cos(x))^2}dx=∫(\sin(x)+\cos(x))dx =\sin(x)-\cos(x)+C$$ is the final answer

Gary
  • 31,845
  • 7
    Have you considered the fact that for some values $v\in\mathbb R$ it might happen that $\sqrt{ v^2 } \ne v$...? – CiaPan Oct 27 '23 at 07:20