Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Solving a system of linear equations

  1. Feb 21, 2005 #1

    I have obtain two third degree polynomials p and q which are determint by the following conditions:

    p(-1) = 1 , p'(-1) = 0

    q(1) = 3 , q'(1) = 0

    p(0) = q(0) , p'(0) = q'(0)

    where p = a_1 * x^3 + b_1 *x^2 + c_1 *x + d_1
    q = a_2 * x^3 + b_2 *x^2 + c_2 *x + d_2

    I then end up with the the following linear equations by inserting the conditions into the equations above:

    -a_1 + b_1 - c_1 + d_1 = 1

    3* a_1 - 2 * b-1 + c_1 = 0

    c_1 = d_1

    3* a_2 + b_2 + c_2 + d_2 = 3

    3 * a_2 + b_2 + c_2

    d_1 = d_2

    By the use of substitution I obtain the result, that

    a_1 = 1/5 , b_1 = 34/5 , c_1 = d_1 = -15/5

    My question is it correct to use substitution? If yes can I use approach to obtain a_2, b_2, c_2 and d_2 ???

  2. jcsd
  3. Feb 21, 2005 #2


    User Avatar
    Science Advisor
    Homework Helper

    I think your approach is, at least in principle, sound. However, it doesn't seem like you're getting the right equations.

    You have:

    Then you can convert your other conditions:
    [tex]p_1(0)=p_2(0) \Rightarrow d_1=d_2[/tex]
    like you have, but I don't see
    [tex]p_1'(0)=p_2'(0) \Rightarrow c_1=c_2[/tex]
    Which may be due to a transcription error. (I'm not going to speculate further on that.)

    Moving on from there, you can certainly solve the system of equations using substitution, or some other method.
  4. Feb 23, 2005 #3
    Hi and thanks for Your answer,

    My problem concerns cubic splines. I'm suppose to determine two third degree polynomials p and q from the conditions given in my earlier post.

    My linear Algebra book doesn't explain this process very well, so I would very much appricate if someone could direct me to a website which explains this process and which hopefully could contain a couple of examples.

    Thanks in advance,


  5. Feb 23, 2005 #4


    User Avatar
    Science Advisor
    Homework Helper

    When you've got a polynomial like
    and something like
    you can just substitute the value in for x. I.e.
    [tex]p(1) \equiv a1^3+b1^2+c1+d[/tex]
    You shouldn't have to deal with solving any kind of cubic to do this problem if you substitute in the x in all of the expressions.
  6. Feb 23, 2005 #5


    User Avatar
    Science Advisor

    The original post (maybe it had been edited before I saw it)
    said that p1[/sup]'(0)= 0, p2'(0)= 0
    That would certainly give c1= 0, c2= 0!
  7. Mar 7, 2005 #6
    You mean I need to put it into a matrix in order to solve it???


  8. Mar 8, 2005 #7


    User Avatar
    Science Advisor
    Homework Helper

    Not really, no. (Although that is an option.) There are many different ways to solve systems of linear equations.

    If you have
    then you have

    What I mean is that in order to solve your system, you don't need any cubics or quadratics since you can just substitute in to get a linear system of equations in the cooeficients.
  9. Mar 9, 2005 #8

    If I assume that [itex]c_{1} = c_{2} = d_{1} = d_{2}=0 [/itex]

    Then the system of equations is reduced to:

    [itex]1 = -a_{1} + b_{1}[/itex]

    [itex]0 = 3a_{1} - 2b_{1}[/itex]

    [itex]3 = a_{2} + b_{2}[/itex]

    [itex]0 = 3a_{2} + 2b_{2}[/itex]

    I then solve the above as two systems of equations and then obtain the following values [itex]a_{1}= 2 , b_{1} = 3 , b_{2} = -6 , a_{2} = 9[/itex]

    This in turn generates two 3 degree polynomials: [itex]p(x) = 2 x^{3} + 3x^2[/itex] and [itex]q(x) = -6 x^{3} + 9 x^{2}[/itex]

    Finally I preform a test by inserting the values: p(-1) = 1, q(1) = 3, p(0) = q(0), p'(-1) = 0, q'(1) = 0, p'(0) = q'(0) into their respective polynomials.

    I then discover that the polynomials give the desired result mentioned above.

    My question is: Doesn't that mean that my approach is correct???

  10. Mar 9, 2005 #9


    User Avatar
    Science Advisor
    Homework Helper

    You have found a solution to the system of equations. Since you have 6 equations, and 8 unknowns, there will be an infinite number of solutions, or no solutions at all.

    So, chose any [tex]c,d[/tex] that you like. Then:
    Is going to solve your system of equations.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook