Question: Adding indexed functions

I have a equation which I want to solve with HPM method, it works this way that you put a series instead of the dependent variable, and make infinite linear differential equation out of your nonlinear, then after solving some of them that meet your accuracy and sum them, that makes the answer. Now I have many problems with this which I hope you may help me.

1. How can I programatically asssign result of a dsolve to the variable? for example when I have dsolve(diff(f(x),x$2)=0,f(x)) it gives me f(x)=C1 x+C2 but what if I want to use this function f(x) later? should I manualy assign the result?

2. if you execute the sheet you will see that the last piece of codes does not work! but if you copy and paste them in another sheet they do work! What's wrong with my sheet?

Please Wait...