Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2010

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

Search the Archive

Re: Keep it real

  • To: mathgroup at
  • Subject: [mg114389] Re: Keep it real
  • From: Ingolf Dahl <ingolf.dahl at>
  • Date: Fri, 3 Dec 2010 05:19:03 -0500 (EST)
  • References: <id2en6$d8l$>

On 30 Nov, 10:04, Sam Takoy <sam.ta... at> wrote:
> Hi,
> Is there a way to make Mathematica stick to real numbers and functions
> as much as possible? For example, could I somehow get two real function
> solutions to the problem
> DSolve[g''[z] + (\[Lambda] Cosh[(z - H/2)/a]^2) g[z] == 0, g, z];
> Many thanks in advance,
> Sam

Have you checked if the solution is real or complex? I obtain the
following solution

{{g -> Function[{z},
    C[1] MathieuC[-((a^2 \[Lambda])/2), (a^2 \[Lambda])/4,
       1/2 I (H/a - (2 z)/a)] -
     C[2] MathieuS[-((a^2 \[Lambda])/2), (a^2 \[Lambda])/4,
       1/2 I (H/a - (2 z)/a)]]}}

The third arguments of MathieusC and MathieusS are imaginary, but

In[1]:= MathieuC[2, 1, 3.2 I]

Out[1]= -2.65844*10^7 + 0. I

In[1]:= MathieuS[2, 1, 3.2*I]

Out[1]= 0. + 2.65844*10^7 I

So if C[1] is chosen real and C[2] imaginary, there is a good chance
that you get a real value out. I have not checked for all values of
the parameters.

Please also look up
for more information about the Mathieu functions.

Best regards

Ingolf Dahl
ingolf.dahl at

  • Prev by Date: Re: Formatting integers in strings
  • Next by Date: Re: Re-virginating Manipulates?
  • Previous by thread: Re: Integral no longer evaluated in Version 7, 8
  • Next by thread: How to modify menus from init.m?