4

I'm having a lot of trouble with a specific question regarding functions, but I'm not sure where to post it.. the question is:

Let $$ y = f(x) = a x^2 + bx + c $$ and have the values ($i \in \{1,2,3\}$): \begin{align} (x_i) &= (3,1,-2) \\ (y_i) &= (32, 6, -3) \end{align} what are $a$, $b$, $c$?

f(x) |-> ax^2 + bx + c, and {x: 3, 1, -2} and the range is, correspondingly, {y: 32, 6, -3} then what are the values of a, b and c?

So far I have done this by using simultaneous equations, but I get a different answer each time! For example, the first time I did it, I got $a = -13/10$, $b = 17/10$ and $c = 28/5$.

But if you plug these numbers in to the function, $f(1)\mapsto 6$, $f(-2) \mapsto -3$ but for some reason $f(3)$ does not return $32$? The second time I did it, I got $a = 25/2$, $b= 31/6$ and $c = -35/3$ which literally did not work at all.

Help? Please?

(PS: I'm not sure if I'm allowed to post a question this simple here, since everyone else seems to be doing university-level math.. If I'm not, inform me and I'll take it down.)

My Work:
4$a$-2$b$+$c$=-3
-($a$+$b$+$c$=6)
=3$a$-3$b$=9

9$a$+3$b$+$c$=32
-(4$a$-2$b$+$c$=-3)
=4$a$+4$b$=35
=3$a$+3$b$=21

3$a$-3$b$=9
-(3$a$+3$b$=21)
= -6$b$=-12

therefore, $b$ = -2

4$a$-(-2 * -2) +c = (-3)
4$a$+4+$c$=(-3)
4$a$+$c$=-7
-($a$-2+$c$=6)
=3$a$=-11

-2-(11/3)+$c$=6
So.. $c$ = (35/3)? and $a$=-(11/3) and $b$ = -2?

Instead of writing my work I just did the problem again from scratch and lo and behold, a completely different answer set.. and this one's wrong, too.

blue sky
  • 123
  • The level of the question is no problem. But it would be better if you included the system of simultaneous equations you got, that might enable us to pinpoint your mistake. – Daniel Fischer Aug 05 '15 at 11:47
  • @DanielFischer I have written my equations as an edit in the original post. – blue sky Aug 05 '15 at 12:45
  • You have a sign error in the first part, you should get $3a - 3b = -9$, for $-3 - 6 = -9$. In the second part, you should get $5a + 5b$ on the left, since $9a - 4a = 5a$ and $3b - (-2b) = 5b$. But that might just have been a typo here, since the $3a + 3b = 21$ is again correct. – Daniel Fischer Aug 05 '15 at 12:50
  • It seems the sign error is the basis of your problem. From $3a - 3b = -9$ and $3a + 3b = 21$, we obtain $6a = 12$ by adding the equations, and $6b = 30$ by subtracting the first from the second. So $a = 2, b = 5$. Take $a+b+c = 6$ to find $c = -1$. Then check $2x^2 + 5x - 1$. $2\cdot 3^2 + 5\cdot 3 - 1 = 18 + 15 - 1 = 32$, good. $2\cdot 1^2 + 5 \cdot 1 - 1 = 2 + 5 - 1 = 6$, good. $2\cdot (-2)^2 + 5\cdot (-2) - 1 = 8 - 10 - 1 = -3$, good. Huzzah! – Daniel Fischer Aug 05 '15 at 12:58
  • How did you go from $4a+4b=35$ to $3a+3b=21$? – Cameron Buie Aug 05 '15 at 12:59
  • @CameronBuie i multiplied everything by 3/4. I think... Oh, crap. No, I multiplied the 35 by 3/5... – blue sky Aug 05 '15 at 13:04
  • @DanielFischer thank you! I always make silly mistakes like that.. I wish you'd written your comments as answers so that I could do the check-mark thingy, though. anyway, thank you so much! you rock. – blue sky Aug 05 '15 at 13:05

2 Answers2

2

Hint:

In matrix form your system is $$ y = X u $$ with the component-wise equations $$ y_i = \sum_{j=1}^3 X_{ij} u_j $$ with $$ y = \left( \begin{matrix} y_1 \\ y_2 \\ y_3 \end{matrix} \right) \quad X = \left( \begin{matrix} (x_1)^2 & x_1 & 1 \\ (x_2)^2 & x_2 & 1 \\ (x_3)^2 & x_3 & 1 \\ \end{matrix} \right), \quad u = \left( \begin{matrix} a \\ b \\ c \end{matrix} \right) $$ E.g. $$ y_3 = (x_3)^2 a + x_3 b + 1 \cdot c $$ which here is $$ -3 = (-2)^2 a + (-2) b + c = (-4,-2,1) \cdot (a,b,c) $$

It has the solution $$ u = X^{-1} y $$ if the matrix $X$ is invertible. This is the case here, and the coefficients $a,b,c$ turn out to be integers.

mvw
  • 34,562
  • I haven't learned Matricies yet. I tried teaching them to myself but it's apparent from how little I understand what you've written that I need to look more into it! Are you saying that to find the values of a, b and c, I have to multiply the inverse of X by y? and if this IS the case, then why are there 6 X values(besides the 3 ones on the right-hand column) instead of only three? – blue sky Aug 05 '15 at 12:45
  • Yes, the vector of $y$ values can by obtained by multiplying the matrix $X$ (which contains powers of the $x$ values) with the coefficient vector $u$. Applying linear algebra methods, this means indeed the inverse of $X$ matrix multiplied with the vector $y$ gives the coefficient vector. There are still only 3 values of $x$, to not confuse indices and powers I added parentheses. You can solve the system of linear equations of course by any other method. – mvw Aug 05 '15 at 12:54
  • The parentheses clarified everything. This is a very, very interesting method I would like to try to use to solve the problem. – blue sky Aug 05 '15 at 13:07
  • holy CRAP! I used the method and it worked perfectly! I'm shocked because I couldn't-- can't --wrap my mind around exactly WHY it works. @mvw do you have a documentation or a site or some kind of reference so I can learn about this? – blue sky Aug 05 '15 at 19:21
  • It is an inhomogenous linear system expressed as $A x = b$. The matrix $A$ is invertible for this problem, so one can solve as $x = A^{-1} b$. This is a subject of linear algebra. There should be many resources for it available. – mvw Aug 05 '15 at 19:32
2

we have to solve the system $$a+b+c=6$$ $$4a-2b+c=-3$$ $$9a+3b+c=32$$ multiplying the first with $-4$ and adding to the second and multiplying the first by $-9$ and adding to the third we obtain $$-6b-3c=-27$$ $$-6b-8c=-22$$ or $$2b+c=9$$ $$3b+4c=1$$ multiplying the first by $-4$ and adding to the second we get $$-5b=-35$$ therefore we obtain $$b=7$$ can you proceed?