Solving a system of linear equations

  • Thread starter Mathman23
  • Start date
  • #1
254
0
Hi

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 ???

Sincerley
Fred
 

Answers and Replies

  • #2
NateTG
Science Advisor
Homework Helper
2,450
6
I think your approach is, at least in principle, sound. However, it doesn't seem like you're getting the right equations.

You have:
[tex]p_1(x)=a_1x^3+b_1x^2+c_1x+d_1[/tex]
and
[tex]p_2(x)=a_2x^3+b_2x^2+c_2x+d_2[/tex]

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.
 
  • #3
254
0
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,

Sincerely
Fred

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

You have:
[tex]p_1(x)=a_1x^3+b_1x^2+c_1x+d_1[/tex]
and
[tex]p_2(x)=a_2x^3+b_2x^2+c_2x+d_2[/tex]

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
NateTG
Science Advisor
Homework Helper
2,450
6
When you've got a polynomial like
[tex]p(x)=ax^3+bx^2+cx+d[/tex]
and something like
[tex]p(1)=5[/tex]
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.
 
  • #5
HallsofIvy
Science Advisor
Homework Helper
41,847
966
NateTG said:
I think your approach is, at least in principle, sound. However, it doesn't seem like you're getting the right equations.

You have:
[tex]p_1(x)=a_1x^3+b_1x^2+c_1x+d_1[/tex]
and
[tex]p_2(x)=a_2x^3+b_2x^2+c_2x+d_2[/tex]

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.)
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!
 
  • #6
254
0
You mean I need to put it into a matrix in order to solve it???

/Fred

NateTG said:
When you've got a polynomial like
[tex]p(x)=ax^3+bx^2+cx+d[/tex]
and something like
[tex]p(1)=5[/tex]
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.
 
  • #7
NateTG
Science Advisor
Homework Helper
2,450
6
Mathman23 said:
You mean I need to put it into a matrix in order to solve it???

/Fred

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

If you have
[tex]p(1)=5[/tex]
and
[tex]p(x)=ax^3+bx^2+cx+d[/tex]
then you have
[tex]5=p(1)=a1^3+b1^2+c1+d=a+b+c+d[/tex]
so
[tex]5=a+b+c+d[/tex]

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.
 
  • #8
254
0
Hi

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???

Sincerley
Fred
 
  • #9
NateTG
Science Advisor
Homework Helper
2,450
6
Mathman23 said:
My question is: Doesn't that mean that my approach is correct???

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.

p(-1) = 1,
p'(-1) = 0,
q(1) = 3,
q'(1) = 0,
p(0) = q(0),
p'(0) = q'(0)
[tex]p(x)=a_1x^3+b_1x^2+c_1x+d_1[/tex]
[tex]q(x)=a_2x^3+b_2x^2+c_2x+d_2[/tex]
So, chose any [tex]c,d[/tex] that you like. Then:
[tex]c_1=c_2=c[/tex]
[tex]d_1=d_2=d[/tex]
[tex]a_1=c-2d+2[/tex]
[tex]b_1=2c-3d+3[/tex]
[tex]a_2=2c+2d-6[/tex]
[tex]b_2=9-3c-3d[/tex]
Is going to solve your system of equations.
 

Related Threads on Solving a system of linear equations

  • Last Post
Replies
11
Views
2K
  • Last Post
Replies
4
Views
5K
  • Last Post
Replies
7
Views
2K
Replies
0
Views
2K
Replies
2
Views
363
  • Last Post
Replies
11
Views
5K
Replies
9
Views
6K
Replies
7
Views
729
Replies
8
Views
2K
Replies
6
Views
1K
Top