MathGroup Archive 2005

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

Search the Archive

Re: Exp-Trig Manipulation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59392] Re: [mg59358] Exp-Trig Manipulation
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Mon, 8 Aug 2005 03:34:38 -0400 (EDT)
  • References: <200508070746.DAA17921@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Daniele Lupo wrote:

>Hi to everyone.
>
>I'd like to know how I can convert this expression
>
>E^((2 - I)*x)*C[1] + E^((2 + I)*x)*C[2] + E^((3 - 4*I)*x)*C[3] + E^((3 +
>4*I)*x)*C[4]
> 
> in its equivalent form
> 
> E^(2*x)*C[2]*Cos[x] + E^(3*x)*C[4]*Cos[4*x] + E^(2*x)*C[1]*Sin[x] + 
> E^(3*x)*C[3]*Sin[4*x]
> 
> 
> I've obtained them while resolving a differential equation. I've tried to
>solve this:
>
>car = y''''[x] - 10*y'''[x] + 54*y''[x] - 130*y'[x] + 125*y[x] == 0;
>
>In two different ways: first, working with characteristic polynomial:
>
>-------------------
>
>(* Conversion from differential equation to characteristic polynomial *)
>
>pol = car /. {Derivative[n_][y][x] -> ë^n, y[x] -> 1};
>
>(* Solutiof of c.p. *)
>
>sol = Solve[pol, ë];
>
>(* Mapping solutions in a linear combination of exponentials *)
>
>solution1 = Plus @@ MapIndexed[C[#2[[1]]]*Exp[x*#1] & , ë /. %]
>
>-------------------
>
>
>While I've obtained second solution using DSolve:
>
>
>-------------------
>
>solution2 = y[x] /. DSolve[car, y[x], x][[1]]
>
>-------------------
>
>So, if I did not wrong something, these two solutions must be equivalent,
>but I can't find a way to trasform solution1 to solution2: I know that
>there can be a problem in conversion of C[n] coefficients during
>transformation, but I don't care it. I'd like instead to convert in the
>right way exponentials of first method in right product of Cos, Sin, Exp of
>the solution obtained with DSolve.
>
>Thanks for answers
>
>Daniele
>
>  
>
Is this what you are trying to do? Anyway here is my attempt

Clear[y, x, sol2, car2, y2, sol1, sol5]
car2[x_] = D[y[x], {x, 4}] - 10*D[y[x], {
x, 3}] + 54*D[y[x], {x, 2}] - 130*y[x]
y[x_] = Exp[s*x]
sol4 = NSolve[car2[x_] == 0, s]
y2[x_] = Total[y[x] /. sol4] // ExpToTrig // ComplexExpand // Simplify //
    Chop
Clear[y, x]
sol5 = DSolve[car2[x] == 0, y, x] // First // N
y3[x_] = y[x] /. sol5[[1]] /. {
C[1] -> 1, C[2] ->
   1, C[3] -> 1, C[4] -> 1} // ExpToTrig // ComplexExpand // Simplify // 
Chop
y2[x] == y3[x]


 >>True

Best regards,
Pratik

-- 
Pratik Desai
Graduate Student
UMBC
Department of Mechanical Engineering
Phone: 410 455 8134



  • Prev by Date: Re: Exp-Trig Manipulation
  • Next by Date: Re: Redefining a function with a rule for coefficients
  • Previous by thread: Exp-Trig Manipulation
  • Next by thread: Re: Exp-Trig Manipulation