Solve a quadratic function passing through 2 defined points

768 Views Asked by At

I'm trying to find the values a, b and c that would validate y = ax^2 + bx + c with the following parameters:

  • For x = 1; y = 1
  • For x = T; y = S

Essentially, I would like the function to pass through the (x, y) coordinates (1, 1) and (T, S) for any given S and T values.

This equates to:

a + b + c = 1
aT^2 + bT + c = S

Any help would be very welcome.

1

There are 1 best solutions below

2
On BEST ANSWER

First of all, you must realise there is no unique solution for $a,b,c$, since two points don't define a unique quadratic parabola.

But you can find $b,c$ in terms of $a$.

Solve your equation system by subtracting one from the other:

$a(S^2-1) + b(S-1) = T-1$

$(S-1)[a(S+1) + b] = T-1$

$b = \frac{T-1}{S-1} - a(S+1)$

and $c = 1-a-b = 1-a+a(S+1) - \frac{T-1}{S-1} = aS - \frac{T-1}{S-1}+1$

So $a$ is a parameter you can vary, which determines the values of $b$ and $c$.

Note that you weren't clear about which values must all be positive. If it's supposed to be all of $a,b,c$, that very much depends on the values of $S$ and $T$. For example, when $S = 3, T=5$, if you choose a value of $a=1$, your $b$ will necessarily be negative. But for the same $S$ and $T$ values, a choice of $a=0.35$ gives positive values for $b\ \ (=0.6)$ and $c\ \ (=0.05)$

Some curve plots (for $a=1,a=2$ and $a=0.35$ with $S=3,T=5$): Plots