$\cos x=f '(x)+f(-x)$
I manage to solve $f '(x)+f(x)= \cos x$, starting first by solving $y'=-y$ using $y=\exp(ax)$. But here I get stuck because of $f(-x)$.
$\cos x=f '(x)+f(-x)$
I manage to solve $f '(x)+f(x)= \cos x$, starting first by solving $y'=-y$ using $y=\exp(ax)$. But here I get stuck because of $f(-x)$.
Copyright © 2021 JogjaFile Inc.
Assume that $f$ is a solution valid on all of ${\mathbb R}$. Then we can write $f$ in the form $f(x)=u(x)+v(x)$ with $u$ an even and $v$ an odd function of $x$. It follows that we have $$u'(x)+v'(x)+u(x)-v(x)\equiv \cos x\ .$$ Separating even and odd parts here entails $$v'(x)+u(x)\equiv\cos x,\qquad u'(x)-v(x)\equiv0\ .\tag{1}$$ It follows that $$u''(x)+u(x)\equiv\cos x\ .\tag{2}$$ Now this is an ordinary differential equation, and we want an even solution of this equation. The general solution of the associated homogeneous equation is $u_{\rm hom}(x)=A\cos x+B\sin x$. A particular solution of the given inhomogeneous equation is found by the Ansatz $u_{\rm part}(x):=x(C\cos x+D\sin x)$ and determining the coefficients $C$ and $D$. Plugging the Ansatz into $(2)$ we obtain $C=0$, $D={1\over2}$. It follows that the general even solution of $(2)$ is given by $$u(x)=A\cos x+{x\over2}\sin x\ ,$$ and the second equation $(1)$ then gives $$v(x)=u'(x)={1\over2}\bigl(x\cos x+(1-2A)\sin x\bigr)\ .$$ This leads to $$f(x)=u(x)+v(x)=A(\cos x-\sin x)+{1\over2}\sin x+{x\over2}(\cos x+\sin x)\ .$$ It remains to check whether such $f$s indeed satisfy the originally given condition. I can leave this to you.