Question: How do I use result of dsolve?

Hi !

I have trouble to do this stuff :

i am solving an ODE and i would like to use the result as a function.

 

example :

>>ode := diff(f(x), x) = 2*x+6;
                        d                
                       --- f(x) = 2 x + 6
                        dx               
>>init := f(0) = 12;
                           f(0) = 12
>>dsolve({init, ode});    
                      f(x) = x  + 6 x + 12

Here everything works fine...

but now i want to define g(x) = f(x)*exp(x) ...

but i can't use g(x) after :

like :

>> g := x -> f(x)*exp(x) ;
                          x -> f(x) exp(x)
g(2);
                          f(2) exp(2)
f(2);
                              f(2)

How can i do that please ??

Thanks,

 

Corentin

 

Please Wait...