I am reading a paper that says $f(x) = a\sin(x) + b\cos(x)$ is a convex function. However, I have not been able to prove it. The function seems relatively simple so maybe I am overlooking something trivial?
2026-05-05 01:54:54.1777946094
On
Convexity of sum of sine and cosine
3.6k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
The function $f(x)$ is not convex.
Another way to show it:
$$f(x)=a \sin x+b \cos x = r (\sin x \cos \phi + \cos x \sin \phi)=r \sin (x+\phi),$$ where $\phi = \tan^{-1} (\frac{b}{a})$ and $r = \sqrt{a^2+b^2}$. $\sin$ is not convex. It can be proved easily. Take two points, $\theta_1 = 0, \ \theta_2 =\pi$ and $\lambda = 0.5$, so $\sin (\pi/2)(=1) > 0.5 (\sin 0+ \sin \pi)(=0)$. This violates the definition of the convex function.
Since your function is differentiable infinitely many times, it is convex if and only if $f''(x) > 0$. Note that $$f''(x) = -a \sin (x) - b \cos(x),$$ so $f''(x) > 0$ clearly does not hold for the entire real line (e.g. $f''(0) =-b < 0$ for $b > 0$). Thus $f$ is not convex over the reals.
You can certainly find some real intervals, where $f$ is true, let me know if you need help with that as well.