(q''[x] - Exp[q[x]/2)] /. q[x] -> y[x] + a*t[x]
gives
-Exp^[1/2 (y[x] + a*t[x])] + q''[x]
Which is not what I want.
I would like to have
-Exp^[1/2 (y[x] + a*t[x])] + y''[x] + a*t''[x]
Is that possible?
Check the FullForm
of your expression. That will make it clear why it doesn't work.
The solution is to replace q
and not q[x]
.
q''[x] - Exp[q[x]/2] /. q -> Function[x, y[x] + a*t[x]]
Recommended reading:
FullForm
before posting and it showed me Derivative[2][q][x]
, hence I assumed (without checking) that if I replace just q
with a function of x
I will get something like (...[x])[x]
and so I didn't even try it
$\endgroup$
Commented
Oct 28, 2016 at 15:40
q -> f[x]
of course won't work. You need q -> Function[x, f[x]]
.
$\endgroup$
q -> (y[#] + a*t[#]&)
. (Duplicate, but I don't have time to look for it.) $\endgroup$