Integral (sin x/2 - cos x/2)^2

  • Thread starter Thread starter b0rsuk
  • Start date Start date
  • Tags Tags
    Cos Integral
Click For Summary

Homework Help Overview

The discussion revolves around the integral of the expression \((\sin \frac{x}{2} - \cos \frac{x}{2})^2\). Participants are exploring various methods to solve this integral, noting discrepancies between their results and a provided solution.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Some participants suggest using trigonometric identities to simplify the integral, while others question the necessity of substitution. There are discussions about the application of double-angle formulas and the expansion of the squared term.

Discussion Status

Participants are actively engaging with the problem, offering hints and alternative methods without reaching a consensus. Some have provided guidance on recognizing identities and simplifying the integrand, while others express confusion about their calculations and results.

Contextual Notes

Several participants mention potential errors in their attempts, including sign errors and misapplications of identities. There is also a reference to the book's solution, which does not align with some participants' findings, prompting further exploration of the integral's evaluation.

b0rsuk
Messages
5
Reaction score
0

Homework Statement



I'm unable to solve this integral. I get a result, but it doesn't match the solution.

\int(sin \frac{x}{2} - cos \frac{x}{2})^2 \mathrm{dx}
\int(sin \frac{x}{2} - cos \frac{x}{2})^2 \mathrm{dx}

The Attempt at a Solution


CodeCogsEqn_gif_300x300_q85.jpg

(attachment?)
I'd be grateful for highligting my errors.
 

Attachments

  • CodeCogsEqn.gif
    CodeCogsEqn.gif
    5.9 KB · Views: 5,447
Physics news on Phys.org
You didnt do the substitution properly.
And there is no need for substitution. Note the identity: \sin(2x)=2\sin x \cos x
 
2sin(x)cos(x) = sin(2x)dx

∫ [2sin(x)] [cos(x)dx] = sin2(x)
∫ [-2cos(x)] [-sin(x)dx] = -cos2(x)
∫ sin(2x)dx = -(1/2)cos(2x)
 
b0rsuk said:

Homework Statement



I'm unable to solve this integral. I get a result, but it doesn't match the solution.

\int(sin \frac{x}{2} - cos \frac{x}{2})^2 \mathrm{dx}
\int(sin \frac{x}{2} - cos \frac{x}{2})^2 \mathrm{dx}

The Attempt at a Solution


CodeCogsEqn_gif_300x300_q85.jpg

(attachment?)
I'd be grateful for highligting my errors.

Hint: simplify with the double-angle formula first.
sin(2z) = 2(sinz)(cosz)

Now put z = (1/2)x and see what you get on the RHS. What do you get on the LHS? Integrate that.
 
Hello b0rsuk. Welcome to PF !

What is the correct answer?
 
Hmm. In such case,
2 \int \sin \frac{x}{2} \cos \frac{x}{2} dx = \int 2 \sin \frac{x}{2} \cos \frac{x}{2} dx = \int \sin x dx = -\cos x + C_1

But what about the first integral ? I know:
\sin^2 x + \cos^2 x = 1
But I have:
\int\sin^2 \frac{x}{2} + \cos^2\frac{x}{2} dx
Can I simply get around that with substitution ? Say,
\frac{x}{2} = t, \frac{1}{2} = dt
Then I get
\frac{1}{2}(\sin^2 t + \cos^2 t)
Does it equal 1 (or, actually, 1/2) ?
--------------------------

The solution, according to the book:
x + \cos x + C
Yes, that's a plus.

---------------
You people are scary. I'm a CS graduate and I came here to defeat my arch-nemesis, math. This time, without time pressure. You rob me of any excuses I might have to procrastinate solving examples.
 
b0rsuk said:
Hmm. In such case,
2 \int \sin \frac{x}{2} \cos \frac{x}{2} dx = \int 2 \sin \frac{x}{2} \cos \frac{x}{2} dx = \int \sin x dx = -\cos x + C_1

But what about the first integral ? I know:
\sin^2 x + \cos^2 x = 1
But I have:
\int\sin^2 \frac{x}{2} + \cos^2\frac{x}{2} dx
Can I simply get around that with substitution ? Say,
\frac{x}{2} = t, \frac{1}{2} = dt
Then I get
\sin^2 t + \cos^2 t
Does it equal 1 ?
--------------------------

The solution, according to the book:
x + \cos x + C
Yes, that's a plus.

---------------
You people are scary. I'm a CS graduate and I came here to defeat my arch-nemesis, math. This time, without time pressure. You rob me of any excuses I might have to procrastinate solving examples.

\sin^2x + \cos^2x = 1 is an identity. Meaning the value of x can be *anything*. Even if you replace the x with x/2, it still holds (just to be clear, that means \sin^2 \frac{x}{2} + \cos^2 \frac{x}{2} = 1). Don't bother with substitution, etc. Just recognise this and reduce the integrand to 1 first.

So the first integrand is 1, and the integral is x.

The second integrand is -\sin x (you correctly reflected the minus sign in your first post, but then you must have forgotten it in your most recent one). The integral is \cos x.

So the final answer is x + \cos x + C.
 
Last edited:
In this case, simple trig substitutions are all you need.
\left(\sin\frac x 2 - \cos \frac x 2\right)^2 = 1 - \sin x
This is an identity, so \int (\sin x/2 - \cos x/2)^2 dx = \int (1-\sin x)\,dx. The right hand side obviously integrates to x+\cos x + c.

So how to arrive at that identity?One way is to expand the square,
\left(\sin\frac x 2 - \cos \frac x 2\right)^2 =<br /> \sin^2 \frac x 2 - 2 \sin \frac x 2 \cos \frac x 2 + \cos^2 \frac x 2
Now use the identities \sin^2 \theta + \cos^2\theta = 1 and \sin(2\theta) = 2 \sin\theta\cos\theta to arrive at the desired identity
\left(\sin\frac x 2 - \cos \frac x 2\right)^2 = 1 - \sin x

Another way is to use the identity \sin\theta- \cos \theta = \sqrt 2 \sin(\theta-\pi/4). This comes in handy at times, but doesn't quite fall into the camp of identities you should just "know". With this,
\left(\sin\frac x 2 - \cos \frac x 2\right)^2 = 2\sin^2\left(\frac x 2 - \frac \pi 4\right) = 2\sin^2\left(\frac 1 2(x-\pi/2)\right)
Now use the half-angle formulae 2\sin^2(u/2) = 1-\cos u. The half-angle formulae come into play quite often. With this,
\left(\sin\frac x 2 - \cos \frac x 2\right)^2 = 1-\cos\left(x-\frac{\pi} 2\right) = 1 - \sin x
 
b0rsuk said:

Homework Statement



I'm unable to solve this integral. I get a result, but it doesn't match the solution.

\int(sin \frac{x}{2} - cos \frac{x}{2})^2 \mathrm{dx}
\int(sin \frac{x}{2} - cos \frac{x}{2})^2 \mathrm{dx}

The Attempt at a Solution


CodeCogsEqn_gif_750x750_q85.jpg

(attachment?)
I'd be grateful for highlighting my errors.
After splitting this up into two integrals, the first one is fine.

You then made offsetting errors -- or simply had a typo.
\displaystyle -2\int\left(\sin\left(\frac{x}{2}\right)\cos\left( \frac{x}{2}\right)\right)dx=-4\int\left(\frac{1}{2}\sin\left(\frac{x}{2}\right)cos\left(\frac{x}{2}\right)\right)dx
\displaystyle=-4\int\left(\sin(t)\cos(t)\right)dt​
After that you dropped a minus sign.

So, the final answer should be \displaystyle x-2\sin^2\left(\frac{x}{2}\right)+C

I know that's not the book's answer, but notice that
1-2\sin^2(\theta)=\cos(2\theta)

So substituting x/2 for θ and doing a bit of algebra gives

\displaystyle -2\sin^2\left(\frac{x}{2}\right)=\cos(x)-1​

Therefore, \displaystyle x-2\sin^2\left(\frac{x}{2}\right)+C=x+\cos(x)-1+C

-1+C is just a constant, one unit less than C.

So, your answer was correct except for a sign error.
 

Attachments

  • CodeCogsEqn_gif_750x750_q85.jpg
    CodeCogsEqn_gif_750x750_q85.jpg
    13.9 KB · Views: 3,169

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 105 ·
4
Replies
105
Views
10K
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K