Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need help to solve this integral: $$\int_0^{2\pi} |a\cos(x)+b\sin(x)|dx$$ where $a^2+b^2=1$. I hope someone is able to help me.

share|cite|improve this question
What you're trying to do is to evaluate an integral, not to solve an integral. One solves problems; one solves equations; one evaluates expressions. – Michael Hardy Apr 9 '12 at 1:22
$\displaystyle{\large a,\ b \in {\mathbb R}\ ?}$. – Felix Marin Aug 7 '14 at 23:33

Hint: Let $\phi$ be a number such that $a=\sin\phi$ and $b=\cos\phi$. You want to integrate $|\sin(x+\phi)|$. Maybe make the natural change of variable, or let the geometry guide you to the answer.

Remark: The "trick" above has a number of uses. The idea works even if $a^2+b^2\ne 1$. For suppose that $a^2+b^2\ne 0$. Note that $$a\cos x+b\sin x=\sqrt{a^2+b^2}\left(\frac{a}{\sqrt{a^2+b^2}}\cos x+\frac{b}{\sqrt{a^2+b^2}}\sin x\right).$$ Let $\phi$ be a number such that $a/\sqrt{a^2+b^2}=\sin \phi$ and $b/\sqrt{a^2+b^2}=\cos\phi$.

share|cite|improve this answer
Thank you for the help. – Carla Johanson Apr 9 '12 at 8:56

Choose $\theta$ such that $\sin(\theta) = a$ and $\cos(\theta)=b$. Then you have $a\cos(x)+b\sin(x) = \sin(\theta)\cos(x)+\cos(\theta)\sin(x)$. A standard trig. identity shows that this can be written as $a\cos(x)+b\sin(x) = \sin(\theta+x)$. Since $x \mapsto \sin(\theta+x)$ is $2 \pi$ periodic, then the integral can be written as $\int_0^{2 \pi} |\sin(\theta+x)|dx = \int_0^{2 \pi} |\sin(x)|dx$ = $\int_0^{\pi} \sin(x)dx - \int_{\pi}^{2\pi} \sin(x)dx = 2 \int_0^{\pi} \sin(x)dx$. I trust you can take it from here.

share|cite|improve this answer
Thank you for the thorough help. – Carla Johanson Apr 9 '12 at 8:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.