       Re: A New User

• To: mathgroup at smc.vnet.net
• Subject: [mg29357] Re: [mg29321] A New User
• From: BobHanlon at aol.com
• Date: Thu, 14 Jun 2001 02:27:32 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```In a message dated 2001/6/13 3:52:22 AM, jim-dars at mediaone.net writes:

>I have a problem of the form:
>
>      (2+Sqrt(3))*(1+2*Sqrt(3))
>
>I would like Mathematica to present the solution in the form (8 +
>5*Sqrt(3)).
>
>Of course, I realize I can calculate the two components.  However, since
>this situation occurs repeatedly in a problem I'm solving, it would be
>very
>convenient to have Mathematica display the answer directly.  In fact, if
>Mathematica could provide me with a=8 and b=5 that would be even better.
>
>My actual problem is of the form:
>
>         (a+b*Sqrt(c))*(d+e*Sqrt(c))^k  = (f+g*Sqrt(c))
>
>where a,b,c,d, and e are positive integers.  c is not a perfect square,
>but
>may contain a square factor.
>k is an integer such that -infinity < k < infinity.   It is desired to
>find
>f and g.  (Actually, just g.)
>

expr = (2+Sqrt)*(1+2*Sqrt);

expr // Simplify

8 + 5*Sqrt

Solve[{a == Select[Expand[expr], FreeQ[#, Sqrt]&],
expr == a+b*Sqrt}, {a, b}][]

{b -> 5, a -> 8}

First, for nonnegative k

(a+b*Sqrt[c])*(d+e*Sqrt[c])^k /. k -> 3 // Expand

a*d^3 + b*Sqrt[c]*d^3 + 3*b*c*e*d^2 + 3*a*Sqrt[c]*e*d^2 +
3*b*c^(3/2)*e^2*d + 3*a*c*e^2*d + b*c^2*e^3 + a*c^(3/2)*e^3

Select[%, !FreeQ[#, c^Rational[_,_]]&]/Sqrt[c]//Simplify

b*d^3 + 3*a*e*d^2 + 3*b*c*e^2*d + a*c*e^3

Consequently,

g[k_Integer?NonNegative] :=
Simplify[Select[
Expand[(a+b*Sqrt[c])*(d+e*Sqrt[c])^k],
!FreeQ[#, c^Rational[_,_]]&]/Sqrt[c]];

For negative k

(a+b*Sqrt[c])*(d+e*Sqrt[c])^k /. k -> -3

(a + b*Sqrt[c])/(d + Sqrt[c]*e)^3

((d-e*Sqrt[c])^3 * Numerator[%])/
Simplify[(d-e*Sqrt[c])^3*Denominator[%]]

((a + b*Sqrt[c])*(d - Sqrt[c]*e)^3)/(d^2 - c*e^2)^3

As before,

g[k_Integer?Negative] :=
Simplify[Select[
Expand[(a+b*Sqrt[c])*(d-e*Sqrt[c])^(-k)],
!FreeQ[#, c^Rational[_,_]]&]/Sqrt[c]]/
(d^2-c*e^2)^(-k);

Table[{k, g[k]}, {k, -4, 4}]//TableForm

Bob Hanlon
Chantilly, VA  USA

```

• Prev by Date: pattern matching quirks
• Next by Date: Re: display factored form
• Previous by thread: Re: A New User
• Next by thread: Re: A New User