Why Can't `DSolve` Find a Solution for this ODE with y[-x]
Take $$ y'(x)+y(x)+y(-x)=0 $$
Write the same equation, with $x\to-x$: $$ y'(-x)+y(x)+y(-x)=0 $$ and subtract the two equations: $$ y'(x)-y'(-x)=0 $$
Integrate this equation: $$ y(x)+y(-x)=2y(0) $$ and plug this back into the initial equation: $$ y'(x)+2y(0)=0 $$ with solution $$ y(x)=y(0)(1-2x) $$
It is easy to check that this solves the initial equation:
y'[x] + y[x] == -y[-x] /. y -> ((-2 y[0] # + y[0]) &)
(* True *)
I hope I didn't mess up the algebra though, so please double check everything.
Put g[x] =f[-x]
, change the sign x
in the equation, then we get a system of two equations that has a solution
DSolve[{f'[x] + f[x] + g[x] == 0, -g'[x] + g[x] + f[x] ==
0}, {f, g}, x]
Out[]= {{f -> Function[{x}, (1 - x) C[1] - x C[2]],
g -> Function[{x}, x C[1] + (1 + x) C[2]]}}
From the condition g[x] =f[-x]
we find C[1] = C[2]