MathGroup Archive 2012

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

Search the Archive

Re: Surprising DSolve problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123969] Re: Surprising DSolve problem
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Tue, 3 Jan 2012 05:26:18 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jdrn85$8sr$1@smc.vnet.net>
  • Reply-to: nma at 12000.org

On 1/2/2012 1:44 AM, Sam Takoy wrote:
> Hi,
>
> I find that my Mathematica (8.0.1)
>
> can do
>
> DSolve[ y''[x] + (2 y[x])/(Cosh[x]^2) == 0, y, x]
>
> but can't do
>
> DSolve[ y''[x] + (2 y[x])/(a^2 Cosh[x/a]^2) == 0, y, x] (*Additional
> constant "a")
>
> If I am not mistaken, the equations are equivalent by a trivial change
> of variables.
>
> What's going on here?
>
> Thanks,
>
> Sam
>

Not sure why but when 'a' is an integer, it is not happy. So this is a way
around it, just add a

                1.0*a

in place of

                  a

in the DSolve, and now it goes through:

-----------------------------------
DSolve[y''[x] + (2 y[x])/(a^2 Cosh[x/(1.0*a)]^2) == 0, y, x]
--------------------------------------------

To make sure I had the solution as

DSolve[ y''[x] + (2 y[x])/(Cosh[x]^2) == 0, y, x]

(Which you say should be the same), I did gave both the
some initial conditions, and plotted the solution
for some random values of 'a', like this:

---------------------------------
ClearAll[y, x, a];
sol1 = y[x] /.
   First@DSolve[{y''[x] + (2 y[x])/(a^2 Cosh[x/(1.0*a)]^2) == 0,
      y[0] == 0, y'[0] == 1}, y[x], x];
-----------------------------------

which gave:

(1. Sqrt[1. -1. Sech[x/a]^2])/Sqrt[1/a^2]

Now plot it

------------------------------
Plot[sol1 /. a -> RandomInteger[10], {x, -.02, .02}, PlotRange -> All]
------------------------------

But when I plot the second solution, for the same range, they
are not the same. (Are sure that adding an 'a' will make
no difference?)

------------------------------------
sol2 = y[x] /.
   First@DSolve[{y''[x] + (2 y[x])/(Cosh[x]^2) == 0, y[0] == 0,
      y'[0] == 1}, y[x], x]
-----------------------------------

Which gave

Tanh[x]

Plot[sol2, {x, -.01, .01}]

does not give the same solution shape.

Tanh[x] =!= (1. Sqrt[1. -1. Sech[x/a]^2])/Sqrt[1/a^2]
for any 'a'.

so, The 2 differential equations do not appear to be the same?
What change of variables will make them the same for any 'a' ?

--Nasser





  • Prev by Date: Re: Using Mathematica output in other programs
  • Next by Date: Re: problem calculating a square simplex IFS triangularization
  • Previous by thread: Re: Surprising DSolve problem
  • Next by thread: Re: Making Transparent Legend Backgrounds