please excuse me for my language but I am German.
What I wanna do is to calculate the vertex of a parabola or its mathematic
equoation of its vertex.
E. g. if I have a equation of the form "a*x^2 + b*x + c = f(x)", I want an
output like the following:
"a*(x-g)+h = f(x)"
I already tried with the command factor, but I didn'T found any possibility
to transform the equoation from above into the last one.
Thank you
Momo
PS: I am really surprised; I thought, that this would be the first or second
hit in documentation of Mathematica, but even with Google, I didn't found
anything.
In[8]:= D[a*x^2 + b*x + c, x]
Out[8]= b + 2 a x
In[9]:= Solve[b + 2 a x == 0, x]
Out[9]= {{x -> -(b/(2 a))}}
So the x-coordinate of the vertex is -b/(2a) and the y-coordinate is
given by:
In[10]:= a*x^2 + b*x + c /. x -> -(b/(2 a))
Out[10]= -(b^2/(4 a)) + c
So the vertex doesn't depend on x as you seem to assume. Your problem
is not really a Mathematica problem, it's more a problem of
mathematics (or actually your grasp of it).
Cheers -- Sjoerd
F[x_] :=a*x^2+b*x+c
(* Its derivative*)
D[F[x], x]
(* The vertex: *)
Solve[D[F[x], x] == 0, x]
(* Vertex coordinates*)
{x, F[x]} /. Solve[D[F[x], x] == 0, x]
>> So the vertex doesn't depend on x as you seem to assume. Your problem
>> is not really a Mathematica problem, it's more a problem of
>> mathematics (or actually your grasp of it).
A more elementary (non-calculus) method of finding the vertex is to
complete the square, which is what the OP asked about. I think the OP
meant to write
a*(x-g)^2+h = f(x) and accidentally left off the square.
Here's one way to do it.
If we want to write y=a x^2 + b x + c
in the form y=a (x - u)^2 + v
Try expanding the second form, than match coefficients.
Expand[a (x - u)^2 + v]
This gives:
a u^2 + v - 2 a u x + a x^2
Now match coefficients and solve for u and v.
Solve[{-2 a u == b, a u^2 + v == c}, {u, v}]
--
Helen Read
University of Vermont
<<Presentations`
CompleteTheSquare[a x^2 + b x + c, x] // InputForm
-b^2/(4*a) + c + a*(b/(2*a) + x)^2
(I used InputForm so as to produce linear output suitable for e-mail.)
--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
after many misunderstandings, I present the "pen and paper-method":
a * x^2 + b*x + c
=a (*x^2 + (b*x)/2*) + c
Now I set (from the underlined from above):
z = x ^ 2 + (b * x)/2
= x ^ 2 + (b * x)/2 + (b/2)^2 - (b/2)^2 ;add term to have form of
a binomial theorem (a+b)^2 = a^2 + 2*a*b + b^2 = (a+b)^2
= (x+(b/2))^2 - (b/2)^2
Now I continue with both terms:
a ((x+(b/2)^2)^2 - (b/2)^2) + c
=a(x+(b/2))^2 - a(b/2)^2 + c
So, my vertex is at X: -(b/2)^2
Y: -a(b/2)^2 + c
I hope this is correct and I didn't miscalculated...
My question now is if there is a comfortable way to calculate form of the
vertex of the parabola.
Thanks
PS: Yes, I've never used derivats because I'm 16 and in 11th form/grade.
Personally, I'd like my students to understand how to do it the more
effortful way :-)
But once they have mastered it, to continue to insist they carry out
those steps can become as pointless as to insist, for example, that they
still extract square-roots using a paper-and-pencil algorithm.
On 9/29/2010 4:12 AM, Helen Read wrote:
> On 9/28/2010 6:06 AM, Murray Eisenberg wrote:
>> In his "Presentations" add-on application, David Park has a function
>> CompleteTheSquare that can save you the effort of carrying out the
>> manipulations:
>>
>> <<Presentations`
>>
>> CompleteTheSquare[a x^2 + b x + c, x] // InputForm
>> -b^2/(4*a) + c + a*(b/(2*a) + x)^2
>
>
> Personally, I'd like my students to understand how to do it the more
> effortful way :-)
>
> --
> Helen Read
> University of Vermont
>
>
--