Re: DSolve solution checking
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1048] Re: DSolve solution checking
- From: withoff (David Withoff)
- Date: Wed, 10 May 1995 08:45:37 -0400
- Organization: Wolfram Research, Inc.
In article <3oeuta$611 at news0.cybernetics.net> bronstei at inf.ethz.ch (Manuel Bronstein) writes:
>In article <3o9mua$b92 at news0.cybernetics.net>,
>Rich Klopp <Rich_Klopp at qm.sri.com> wrote:
>>I am having difficulties checking the solution of a 2nd order ODE obtained
>>using DSolve. I define the equation leftside == 0 using the next 3 lines:
>>
>>r[z] := a z^2 + g
>>
>>leftside = (r[z]^2 + e) D[u[z],{z,2}] +
>> D[r[z]^2,z] D[u[z],z];
>>
>>bndEq = (leftside == 0)
>>
>>4 a z (g + a z^2) u'[z] + (e + (g + a z^2)^2) u''[z] == 0
>>
>> [...
>>However, mathematica 2.2.1 on the PowerMac doesn't seem to know.
>>
>>% == 0 //Short
>>
>>{<<1>>} == 0
>>
>>Why can't Mathematica tell if it got the right answer?
>
>My reply properly won't get posted if I tell you what I think about it. If you
>do need a correct solution however, the general solution to your equation has
>the form
>
> / dz
> u(z) = C1 + C2 | -----------------------
> | 2 4 2 2
> / a z + 2a g z + g + e
>
>for arbitrary constants C1 and C2 (yes it can be checked with the system
>I used to get it).
>
>-----------------------------------------------------------------------------
>
> ____________ Manuel Bronstein
> / / / / bronstein at inf.ethz.ch
> /--- / /___/ Institute for Scientific Computation
> / / / / ETH Zurich, Switzerland
> ---- / / / Tel: [+41] (1) 632-7474
> Fax: [+41] (1) 632-1172
>
> http://www.inf.ethz.ch/department/WR/html/people/bronstein.html
>
>-----------------------------------------------------------------------------
This worked ok in Mathematica Version 2.2 (and Version 2.1) when I tried
it. What version of Mathematica were you using? Did you load the
Calculus`DSolve` package?
Here is what happened when I tried this in Version 2.2:
In[1]:= << Calculus`DSolve`
In[2]:= r[z] := a z^2 + g
In[3]:= leftside = (r[z]^2 + e) D[u[z],{z,2}] +
D[r[z]^2,z] D[u[z],z];
In[4]:= bndEq = (leftside == 0)
2 2 2
Out[4]= 4 a z (g + a z ) u'[z] + (e + (g + a z ) ) u''[z] == 0
In[5]:= sol = DSolve[bndEq, u, z]
1
Out[5]= {{u -> (C[2] + C[1] Integrate[---------------------------, #1] & )}}
2 2 2 4
e + g + 2 a g #1 + a #1
which is the solution suggested above. The result can be checked
by substituting it back into the original equation.
In[6]:= Simplify[bndEq /. sol]
Out[6]= {True}
In the version of Mathematica under development, you don't need to
load the Calculus`DSolve` package, and the integral is evaluated
in closed form. Even with Version 2.2, though, the result looks fine.
Dave Withoff
Research and Development
Wolfram Research