Question: Defining a function using a solution of dsolve

I am trying to define a function in terms of a solution of dsolve. I initially tried the following method:

I defined my function as:
a := 10; ode := diff( n(t), t ) + a*n(t);

Then I solve it using dsolve and store it as a function:
f:= t -> dsolve( ode, n(0) = 10);

This was syntactically wrong so I tried:
f:= t-> rhs( dsolve( ode, n(0) = 10) );

There were a few other variations - like assigning rhs( dsolve( ode, n(0) = 10) ); to another variable and then defining f as a function of t for variable.

None of this has worked. I have tried reading through the user manuals and also the forum, however I cannot find an example of the correct syntax for this statement. Any pointers on what I have done wrong and how to correctly write the statement would be great! Also, if there is a resource you know of that gives this information please let me know where to find it so I don't come back with a similar problem =D

Thanks in advance,

Rich

Please Wait...