0
$\begingroup$

How would I go about creating a polynomial $f$ such that
\begin{align*} f(x) &= A_1\\
f(y) &= A_2\\
f'(x) &= B_1\\
f'(y) &= B_2 \end{align*}
With $x$ not equal to $y$ and $A_1$, $A_2$, $B_1$, $B_2$ real numbers?

  • 0
    @JimJones: I've tried$a$different tack; see if that is what you are hoping for.2010-11-15

2 Answers 2

5

In general, there are many possible answers. But, suppose your polynomial looks like this: $f(X) = a_n X^n + \cdots + a_1 X + a_0$ with $a_0,\ldots,a_n$ real numbers. Then f'(X) = na_n X^n + \cdots + a_1. Evaluating at $x$ and at $y$ will give you a bunch of equations that they need to satisfy: \begin{align*} a_n x^n + \cdots + a_1x + a_0 & = A_1\\ na_n x^{n-1} + \cdots + a_1 &= B_1\\ a_n y^n + \cdots a_1y + a_0 &= A_2\\ na_n y^{n-1} + \cdots a_1 &= B_2. \end{align*} You cannot really to get an answer if the degree of the polynomial is $0$ or $1$: too many equations with too few unknowns. Degree $2$ would give you four equations with three unknowns, which may be too restrictive as well. So your best hope of having it be solvable and not too hard is for the degree (for $n$) to be $3$. Then you'll have a bunch of equations like so: $\begin{array}{rcrcrcrcl} a_3 x^3 &+& a_2 x^2 &+& a_1 x &+& a_0 &=& A_1\\ a_3 y^3 &+& a_2 y^2 &+& a_1 y &+& a_0 &=& A_2\\ 3a_3 x^2 &+& 2a_2 x &+& a_1 & & &=& B_1\\ 3a_3 y^2 &+& 2a_2 y &+& a_1 & & &=& B_2. \end{array}$ So you go ahead and solve this system in one of the standard ways; for example, back substitution if you don't know the methods from linear algebra.

Added: How to solve these if you don't know linear algebra? The less sophisticated method is probably to "solve and backsubstitute". Using the last equation, you can write $a_1$ using $y$, $a_2$, $a_3$, and $B_2$. Substitute that value into each of the previous three equations, and then each of those equations only has three unknowns. Then use one of them to write $a_2$ in terms of the other two unknowns, and substitute that into the remaining two equations. Then use one of them to "solve" for one unknown in terms of the other, and substitute into the remaining one. Solve for the unknown, and then work backwards.

For example, suppose that $x=2$ and $y=3$, $A_1 = -2$, $A_2=1$, $B_1 = 0$, and $B_2 = 1$ (I just picked those at random). So the equations become: $\begin{array}{rcrcrcrcl} 8a_3 &+& 4a_2 &+& 2a_1 &+& a_0 &=& -2\\ 27a_3 &+& 9a_2 &+& 3a_1 &+& a_0 &=& 1\\ 12a_3 &+& 4a_2 &+& a_1 & & &=& 0\\ 27a_3 &+& 6a_2 &+& a_1 & & &=& 1. \end{array}$ From the last equation, you have that $a_1 = 1 - 27a_3 - 6a_2$. Plugging that into each of the other three equations you get: $\begin{array}{rcrcrcl} -36a_3 & - & 8a_2 & + & a_0 &=& -4\\ -54a_3 & - & 9a_2 & + & a_0 & = & -2\\ -15a_3 & - & 2a_2 & & & = & -1. \end{array}$ Then we can use the first equation to write $a_0 = 36a_3 + 8a_2 - 4$, and substituting into the second equation we get $\begin{array}{rcrcl} -18a_3 & - & a_2 & = & 2\\ -15a_3 & - & 2a_2 & = & -1. \end{array}$ From the first equation you get $a_2 = -18a_3-2$, which plugged into the second equation gives $21a_3=-3$, or $a_3 = -\frac{1}{7}$. This gives you the value for $a_2$, since you know $a_2 = -18a_3-2$; once you have $a_2$ and $a_3$, you use $a_0 = 36a_3+8a_2-4$ to find $a_0$; once you have $a_0$, $a_2$, and $a_3$, you use $a1 = 1 - 27a_3 - 6a_2$ to find $a_1$.

You can do the back-substitution in any order; this is not the best way of doing it, but it's certainly a way that may have occurred to you if you have ever solved a system of two equations with two unknowns. It's called "back-substitution" because you use one equation to isolate a variable, then you "substitute it" into the equations that are "at the bacK", the other equations.

Trying to do this for more equations with more unknowns quickly becomes far too annoying, which is why there are better methods, such as Gaussian Elimination.

Added 2: If, as your comments in the question suggest, you are supposed to come up with generic formulas for arbitrary numbers $A_1, A_2,B_1,B_2$, $x$, and $y$, then this method is difficult, though you can push it through if you are careful and are really comfortable with algebra. You have to remember that $x$, $y$, $A_1$, $A_2$, $B_1$, and $B_2$ are supposed to be numbers, not variables, so if you can write $a_i$ in terms only of these, then you've "solved" $a_i$. Your final answer would express $a_0$, $a_1$, $a_2$, and $a_3$ in terms of $A_1$, $A_2$, $B_1$, $B_2$, $x$, and $y$.


Added 3: Your comments clearly say now that you are trying to come up with formulas that you can just plug $x$, $y$, $A_1$, $A_2$, $B_1$, and $B_2$ into to get your polynomial. You are not going to be able to come up with them using the methods discussed so far. Not because it's impossible, but because you are not exhibiting the kind of comfort with algebra that you would need for that. It would involve carrying around fairly ugly expressions around in a comfortable way, and it seems clear you cannot do this.

So let's try a slightly different tack.

Start slow. A simple way to get a polynomial that will give you $A_1$ when evaluated at $x$ and $A_2$ when evaluated at $y$ is to "cheat": make it a sum of two polynomials, one zero at $x$ and the other zero at $y$, and then just adjust things so they come out right. So you can take, for example, something like $f(X) = K(X-x) + M(X-y).$ Then $f(x) = M(x-y)$ and $f(y)=K(y-x)$. So you get easy formulas for $M$ and $K$: since $M(x-y)=A_1$, then $M = A_1/(x-y)$ (which you can do because $x\neq y$); and since $K(y-x) = A_2$, then $K=A_2/(y-x)$. So we get $f(X) = \frac{A_2}{y-x}(X-x) + \frac{A_1}{x-y}(X-y).$ Now, this is not going to do it for the derivatives, though. So we are going to have to add things to this polynomial to get the derivatives to come out right. How can we add things so as not to mess up what we've already achieved (that the first two equations are satisfied)? Well, we can make sure we don't mess up what we already have if we make sure that whatever we add has value $0$ at both $x$ and $y$. So we'll try something like: $f(X) = \frac{A_2}{y-x}(X-x) + \frac{A_1}{x-y}(X-y) + (X-x)(X-y)g(X)$ for some $g(X)$. What is the derivative of such an $f(X)$? Remembering that $x$, $y$, $A_1$, and $A_2$ are numbers, then applying the product rule we have: f'(X) = \frac{A_2}{y-x} + \frac{A_1}{x-y} + (X-y)g(X) + (X-x)g(X) + (X-x)(X-y)g'(X). If you evaluate at $x$, we get B_1 = f'(x) = \frac{A_2}{y-x}+\frac{A_1}{x-y}+(x-y)g(x). Everything is numbers that we'll know, except for $g(x)$. So that means that we need $g(x) = \frac{B_1}{x-y} - \frac{A_2}{(y-x)(x-y)} - \frac{A_1}{(x-y)^2}.$ And if we evaluate f'(X) at $y$ we get $B_2 = \frac{A_2}{y-x} + \frac{A_1}{x-y} + (y-x)g(y).$ Again, everything except $g(y)$ are numbers we already are supposed to know. So we get: $g(y) = \frac{B_2}{y-x} - \frac{A_2}{(y-x)^2} - \frac{A_1}{(x-y)(y-x)}.$ Notice that the derivative of $g(X)$ turns out to not play any role at all after all! So we can make $g(X)$ as simple as we possibly can; say, a linear polynomial.

How can we achieve this? Well, we discussed above how to make a polynomial of degree $1$ that has specific values at two different points, right? So you can just use the same trick we used for $f(x)$ and $f(y)$, but with $g(x)$ and $g(y)$, using the (complicated) expressions we just found for $g(x)$ and for $g(y)$ instead of the $A_1$ and $A_2$ that we used for $f(X)$. So go to it.

Note: You can keep playing with this if you have still more points-and-values; it gets progresssively more difficult. You would need to start with polynomials of degree $n-1$ if you know the value at $n$ points; this leads you to Lagrange Interpolation polynomials. The advantage of the linear algebra method is that the complexity grows in a bit more manageable fashion than this method.

  • 0
    @J.M.: Yes; I mention Lagrange polynomials right after "You would need to start with polynomials of degree n-1 if you know the value at n points"; that is, to get started before looking at the derivative (before trying to figure out what I called $g(x)$)2010-11-15
3

This would be a typical question given in the beginning of a linear algebra class. You have the information that $f(x)$ passes through the points $(X,A_1)$ and $(Y,A_2)$ and f'(x) passes through the points $(X, B_1)$ and $(Y,B_2)$.

So you have a set of 4 linear equations for 4 unknowns. Try setting up a linear system and solving it. Hint: The first condition could be written as $[X^3 \;\; X^2 \;\; X \;\;\; 1] \left[\begin{array}{c}a\\ b\\ c\\ d\\\end{array} \right] =A_1 $

When you put together all 4 of your equations you end up with an augmented matrix which you can put in RREF form to find your answer

  • 0
    I'm sorry, I'v$e$ never taken linear algebra. I feel like this is supposed to be really simple but I just don't understand it at all2010-11-15