MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Finding solutions to differential eqns


Certainly, but you have to study some Mathematica basics, learn how to use
the various brackets, how to write derivatives, how % works, how Functions
work, read the Help for DSolve, learn how solutions are returned as rules,
and how to convert the rule to a definition of the function that solves your

Here is your last equation...

Clear[x, c, t];
DSolve[x'[t] == (t - 4)*E^(4*t) + t*x[t],
   x, t][[1,1]]
% /. C[1] -> c
x[c_][t_] = Simplify[x[t] /. %]

which gives...

x -> Function[{t}, -((-4*E^(4*t) + E^(4*t)*t)/
      (-4 + t)) + E^(t^2/2)*C[1]]
x -> Function[{t}, -((-4*E^(4*t) + E^(4*t)*t)/
      (-4 + t)) + E^(t^2/2)*c]
-E^(4*t) + c*E^(t^2/2)

1) First the symbols used in the equation were cleared.
2) DSolve solves the differential equation and the first solution was picked
out with [[1,1]].
3) Mathematica solves in terms of a general constant C[1]. But this is an
expression so it it replaced with the symbol c.
4) Then the definition for x[c][t] is given. c is a parameter and t is the
variable. It is done by writing x[t] and then using the DSolve solution to
substitute for x.

We can now use the definition. For example...

-E^(4*t) + E^(t^2/2)


Plot[x[1][t], {t, -1, 1}];

The solution does solve the equation.

x[c]'[t] == (t - 4)*E^(4*t) + t*x[c][t]//Simplify

David Park
djmp at

From: David [mailto:davidol at]
To: mathgroup at
Subject: [mg40114] [mg40091] Finding solutions to differential eqns

Is there a method where you can get Mathematica to find general
solutions for differential equations?  For example:

[2xt(1 + t)]dx/dt = 1 + x^2

dx/dt = (t/x)e^(-x/t) + x/t


dx/dt = (t - 4)e^4t + tx

I have access to version 4.0



  • Prev by Date: Re: simple question if/while loop
  • Next by Date: Re: Increase in efficiency with Module
  • Previous by thread: Re: Finding solutions to differential eqns
  • Next by thread: Remote site, terminal emulator in Windows