manipulating output of a quadratic expression after factor to a general form
Subject: manipulating output of a quadratic expression after factor to a general form
From: Stavros Macrakis
Date: Wed, 16 Nov 2011 21:41:23 -0500
First of all, welcome to the Maxima community!
Re "why this is not easily possible". There are many ways to represent
expressions. Factor chooses a canonical one, namely a rational function
(polynomial divided by polynomial). After all, (x+1)/x = x*(1+1/x^2) =
(1/x)*(x^2+1) = 1 + 1/x etc. An even simpler case: x^3/y^2 = x*(x/y)^2 =
(x^(3/2)/y)^2 etc. And for that matter, if it didn't choose a canonical
form, why wouldn't it return e.g. (x+1)*(1+1/x)/x instead of (x+1)^2/x^2 or
(1+1/x)^2?
In fact, for your example, Maxima doesn't even "think
of" (2*a*x+b)^2/(4*a^2) as a quotient, but as a product of three
multiplicands: 1/4, a^-2, and (2*a*x+b)^2.
That said, it certainly *is* possible to transform from one form to the
other by explicit (programmatic) transformations....
-s
On Wed, Nov 16, 2011 at 15:49, <horatio at familiedeskranichs.info> wrote:
> I have this worksheet:
>
> Maxima 5.24.0 http://maxima.sourceforge.net
> using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL)
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> (%i1) a * x^2 + b * x + c = 0;
> 2
> (%o1) a x + b x + c = 0
> (%i2) % - c;
> 2
> (%o2) a x + b x = - c
> (%i3) % / a;
> 2
> a x + b x c
> (%o3) ---------- = - -
> a a
> (%i4) expand(lhs(%)) = rhs(%);
> 2 b x c
> (%o4) x + --- = - -
> a a
> (%i5) % + b^2/(2*a)^2;
> 2 2
> 2 b x b b c
> (%o5) x + --- + ---- = ---- - -
> a 2 2 a
> 4 a 4 a
> (%i6) factor(lhs(%)) = rhs(%);
> 2 2
> (2 a x + b) b c
> (%o6) ------------ = ---- - -
> 2 2 a
> 4 a 4 a
> (%i7)
>
>
> but I would like to have the last expression as:
>
> (%i7) (x + b/(2*a))^2 = rhs(%);
>
>
> 2
>
>
> b 2 b c
>
>
> (%o7) (x + ---) = ---- - -
>
>
> 2 a 2 a
>
>
> 4 a
>
>
> (%i8)
>
> So, if anyone knows a simple solution, or why this is not easily possible,
> please share.
> Thank you.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>