Question

In: Mechanical Engineering

Two polynomials in the variable x are represented by the coefficient vectors p1 = [6,2,7,-3] and p2 = [10,-5,8].

Two polynomials in the variable x are represented by the coefficient vectors p1 = [6,2,7,-3] and p2 = [10,-5,8].

a. Use MuPAD to find the product of these two polynomials; express the product in its simplest form.

b. Use MuPAD to find the numeric value of the product if x = 2.

Solutions

Expert Solution

a)

For defining the polynomial in the variable x, we will first define a symbolic variable x. To define the polynomial with given coefficient vectors, we will use poly2sym function which will convert the polynomial expression to symbolic expression.

Input:

syms x %defining the symbolic variable x

p1=poly2sym([6,2,7,-3],x); %defining polynomial 1

p2=poly2sym([10,-5,8]) ; %defining polynomial 2

product=p1*p2; %finding the product

disp('product of two polynomial is: ')

disp(product) %displaying the product

disp('product of two polynomial in simplest form is: ')

disp(expand(product)) %using expand we can simplify the product

Output:

b)

For finding the value of product at x=2, we can use subs function which will substitute the variable x with 2 and compute the expression as follows,

Input:

syms x %defining the symbolic variable x

 

p1=poly2sym([6,2,7,-3],x); %defining polynomial 1

p2=poly2sym([10,-5,8]) ; %defining polynomial 2

product=p1*p2; %finding the product

val=subs(product,2); %substituting x=2 to the product

disp('The value of the product at x=2 is:')

disp(val)

Output:


a) For defining the polynomial in the variable x, we will first define a symbolic variable x.

b)

For finding the value of product at x=2, we can use subs function which will substitute the variable x with 2 and compute the expression as follows,

 

Related Solutions

Vectors p1 = [10 2] and p2 = [2 15] are represented in o1x1y1 coordinate frame....
Vectors p1 = [10 2] and p2 = [2 15] are represented in o1x1y1 coordinate frame. Translate o1x1y1 by t = [30 1]T and rotate by 45◦ to obtain o2x2y2. Is the dot product of p1 and p2 same in o1x1y1 and o2x2y2? I believe o1x1y1 and o2x2y2 are the pair of vectors before and after the translation and rotation
P1=4x-z-3, p2=x+2y+z a) The two planes P1 and P2 will intersect in a line. Find the...
P1=4x-z-3, p2=x+2y+z a) The two planes P1 and P2 will intersect in a line. Find the Cartesian coordinate of the point at which the two planes P1 and P2 intersect and x = 0 b) find the vector equation of a line which is the intersection of the two planes P1 and P2.
Show that the Legendre polynomials P1 and P2 are orthogonal by explicit integration. Also show that...
Show that the Legendre polynomials P1 and P2 are orthogonal by explicit integration. Also show that when (P2)^ 2 is integrated over the full range of integration, the result is 2 /(2l+1) , where l is the order of the polynomial.
Consider the planes P1 : x + 2y − 3z = 3 and P2 : 4x...
Consider the planes P1 : x + 2y − 3z = 3 and P2 : 4x + y + z = 6. (a) Find a set of parametric equations for the line of intersection of the P1 and P2. (b) Find an equation in the standard for the plane that is perpendicular to the line of intersection of P1 and P2 (the one you found in part (a)) and contains the point A(3, −1, 2).
find Lagrange polynomials that approximate f(x)=x^3, a) find the linear interpolation p1(x) using the nodes X0=-1...
find Lagrange polynomials that approximate f(x)=x^3, a) find the linear interpolation p1(x) using the nodes X0=-1 and X1=0 b) find the quadratic interpolation polynomial p2(x) using the nodes x0=-1,x1=0, x2=1 c) find the cubic interpolation polynomials p3(x) using the nodes x0=-1, x1=0 , x2=1 and x3=2. d) find the linear interpolation polynomial p1(x) using the nodes x0=1 and x1=2 e) find the quadratic interpolation polynomial p2(x) using the nodes x0=0 ,x1=1 and x2=2
Assume you have two processes, P1 and P2. P1 has a high priority, P2 has a...
Assume you have two processes, P1 and P2. P1 has a high priority, P2 has a low priority. P1 and P2 have one shared semaphore (i.e., they both carry out waits and posts on the same semaphore). The processes can be interleaved in any arbitrary order (e.g. P2 could be started before P1).             i.             Explain the problem with priority inversion Briefly explain whether the processes could deadlock when:            ii. both processes run on a Linux system as...
Prove that P1, P2 ⊢ C P1: (∀x)(∃y)(P(x) ⇒ (Q(y) ∧ T(x, y)∧ ∼ S(x, y)))...
Prove that P1, P2 ⊢ C P1: (∀x)(∃y)(P(x) ⇒ (Q(y) ∧ T(x, y)∧ ∼ S(x, y))) P2: (∃x)(∀y)(P(x) ∧ ((Q(y) ∧ R(x, y)) ⇒ S(x, y))) C: ∼ (∀x)(∀y)((P(x) ⇒∼ T(x, y)) ∨ (Q(y) ⇒ R(x, y)))
Do the polynomials x^3 + x + 2, x^2 - x +2, -x^3 + x^2 -...
Do the polynomials x^3 + x + 2, x^2 - x +2, -x^3 + x^2 - 5x + 3, and x^3 + 2 span P3? (show your conclusion.)
Let pi = P(X = i) and suppose that p1 + p2 + p3 + p4...
Let pi = P(X = i) and suppose that p1 + p2 + p3 + p4 = 1. Suppose that E(X) = 2.5. (a) What values of p1, p2, p3, and p4 maximize Var(X)? (b) What values of p1, p2, p3, and p4 minimize Var(X)?
2. Suppose a consumer has an income of $100. P1=10 and p2=10. a. Draw the consumer's...
2. Suppose a consumer has an income of $100. P1=10 and p2=10. a. Draw the consumer's budget constraint b. On the same drawing, add an indifference curve on which the optimal basket lies. Assume the indifference curve is convex as usual c. On the same drawing, add an indifference curve which has a lower utility level than the optimal basket. Make sure to include the intersections of the curve with the budget constraint, and carefully explain why they cannot be...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT