Question: changing all y(x) and all its derivatives in expression?

Currently, when I have solution to an ode, say y(x)=sin(x)+_C1 and have some initial condition, then to solve for _C1,  I manually substitute the solution into the IC and replace each x by x0 and replace each derivative manually and so on.

This is because I could not find automatic way to do this. Using another software, it is possible to automate this by writing the solution using the  y -> Function[{x}, ...] syntax. But in Maple, I was not sure how to do the same.

Here is a simple made up example. 

sol:= y(x) = sin(x)+_C1;
IC := a*D(y)(x0)+c*y(x0)= b*y0+exp((D@@2)(y)(x0));

The goal is to replace the solution (which is function y(x)) into the IC, and automatically replace all its derivatives and replace x by x0 then solve for _C1 from the equation that results.

Now I do this manually like this

eval(IC,[ y(x0)=eval(rhs(sol),x=x0), 
          D(y)(x0)=eval(diff(rhs(sol),x),x=x0), 
         (D@@2)(y)(x0)= eval(diff(rhs(sol),x$2),x=x0) ])

which gives

But this is too much work.

Using the other software, I can do the above much more easily like this

sol = y -> Function[{x}, Sin[x] + C[1]]
ic = a*y'[x0] + c*y[x0] == b*y0 + Exp[y''[x0]];
ic /. sol

I looked at algsubs, dchange, or making the solution as function instead, and so on but could not emulate the y -> Function[{x}, Sin[x] + C[1]] method in Maple.

What would be similar method in Maple to do the above automatically?  May be there is already builtin function in Maple?

Please Wait...