For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > April 2007 > Re: writting an expression









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: writting an expression
Daniel Lichtblau

2007-04-25, 8:10 am

dimitris wrote:
> Hello.
>
> I have the expression
>
> In[193]:=
> ee = 1/(1 + o^4);
>
> and I want to write in the form
>
> Out[194]=
> (-Sqrt[2] + o)/(2*Sqrt[2]*(-1 + Sqrt[2]*o - o^2)) + (Sqrt[2] + o)/
> (2*Sqrt[2]*(1 + Sqrt[2]*o + o^2))
>
> Currently I can think something like
>
> In[237]:=
> 1 + o^4 == (a + b*o + o^2)*(c + d*o + o^2) + O[o]^5
> LogicalExpand[%]
> ({ToRules[#1]} & )[(Reduce[#1, {a, b, c, d}] & )[Reduce[% && a < b,
> Reals]]]
> Apart[1/((a + b*o + o^2)*(c + d*o + o^2) /. %[[1]])]
>
> Out[237]=
> 1 + o^4 == SeriesData[o, 0, {a*c, b*c + a*d, a + c + b*d, b + d, 1},
> 0, 5, 1]
>
> Out[238]=
> -1 + a*c == 0 && b + d == 0 && b*c + a*d == 0 && a + c + b*d == 0
>
> Out[239]=
> {{a -> 1, b -> Sqrt[2], c -> 1, d -> -Sqrt[2]}}
>
> Out[240]=
> (-Sqrt[2] + o)/(2*Sqrt[2]*(-1 + Sqrt[2]*o - o^2)) + (Sqrt[2] + o)/
> (2*Sqrt[2]*(1 + Sqrt[2]*o + o^2))
>
> Any other ideas?
>
> Thanks.
> Dimitris
>


Factor denominator over Q[Sqrt[2]], then do Apart of 1/result.

In[42]:= InputForm[Apart[1/Factor[1+o^4,Extension->Sqrt[2]],o]]

Out[42]//InputForm=
(-Sqrt[2] + o)/(2*Sqrt[2]*(-1 + Sqrt[2]*o - o^2)) +
(Sqrt[2] + o)/(2*Sqrt[2]*(1 + Sqrt[2]*o + o^2))


Daniel Lichtblau
Wolfram Research

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com