Mathcad Homework
Submit as ONE MC Worksheet on Collab. Number each problem clearly.
You may work together. It is more fun and you can actually learn more. As in any sport, watching without doing does not develop your skills, so be an active participant. As in skiing, you won’t learn if you don’t fall down. While getting started, it is easy to fall down with Mathcad. Mathcad has a good help menu, which can be brought up using the F1 special function key. Don’t forget the Quick Sheets. If you run into a continuing problem see me. But bring your computer or the problem on a jump drive. I don't debug software in the abstract.
Full credit or no credit. You have to get everything right.
If you work together, each person should submit their assignment separately. But indicate at the top of the worksheet who you worked with if it was a group effort and who the partners were.
1. For each of the two functions symbolically compute the derivative and the integral, making each a function. For f(x), on one graph plot the function, its derivative, and its integral over the range 0 to 5 in steps of 0.1. On a separate graph, do the same for f2(x).
a)
image1.wmf
f
x
(
)
exp
x
-
(
)
1
exp
x
-
2
æ
ç
è
ö
÷
ø
+
:=
b)
image2.wmf
f2
x
(
)
sin
x
-
(
)
1
exp
x
-
2
æ
ç
è
ö
÷
ø
+
:=
HINT and WARNING: While virtually every function can be differentiated in closed form, many if not most arbitrary functions cannot be integrated symbolically. That is you will not be able to get a symbolic solution. But you can still plot it. Failure to have a symbolic solution doesn’t stop Mathcad, which is as at home with numerical integration as it is with symbolic ones as long as the limits are numerical. If you have a function g(x) that will not integrate symbolically, just define the function in terms of the definite integral function on the calculus palette. For example, if you have the function x3/(sin(x)+x+1) integrated between 0 and z just fill in the blanks and you have
image3.png
where g1 is a function given by the definite integral. Even if there is no closed form for the integral (there isn’t in this case), Mathcad can evaluate the g1(z) numerically for numeric values of z. You can then plot functions like this as if they were defined in the usual way. If you get a flat line in any of your results, you are wrong. If your x axis does not span the 0 to 5, you are wrong. If you get jaggies rather than a smooth curve you are wrong. Fix it before you turn it in.
Be really careful about the minus signs in the exponentials. They should be smooth or smoothly oscillating functions that fall off to zero as you go to large positive and negative values.
2. The first three vibrational wave functions for a vibrating diatomic are given by
image4.wmf
V0
(
)
x
.
.
1
.
2
0
!
!
0
e
x
2
2
1
image5.wmf
V1
(
)
x
.
.
1
.
2
1
!
!
1
e
x
2
2
(
)
.
2
x
image6.wmf
V2
(
)
x
.
.
1
.
2
2
!
!
2
e
x
2
2
.
4
x
2
2
Plot these functions over the range -5
Show that V0 and V1 are orthogonal to each other. That is
image7.png
Obviously, you cannot integrate between –infinity to + infinity. But you can integrate over a range that covers the bulk of the function. You can check that you went far enough by integrating again over a wider range. Try a limit of 10, 100, and 10000 and see what you get.
3. A powerful way of treating complex functions is to expand them in Taylor series. Mathcad has this feature built into the Symbolic menu. Expand the function
image8.png
in a power series in x up to the 5th order term in x. Expanding in power series does not work on functions as written above. You must take only the rhs of the expression and work on it independently. To expand, highlight x, pull down the Symbolic Menu, Variable, and activate Expand to Series. You will be given the rough order of the approximation. The default is 6, which means that expansion is to the 5 (or 7) order in x. You can change this by merely over-typing the 6. Define this new function as g5(x). Repeat the expansion of g(x) to the ninth power in x and define this function as g9(x). Over the range in x of 0 to 3, plot g(x), g5(x), and g9(x) to compare how good the approximations are.
4. Integrate the following functions using the integrate from the calculus palette along with ( function (on the evaluation palette).
image9.emf
x
f
x
(
)
d
xfx()d
where f(x) is the following three functions
f(x)= exp(a x); image10.emf
x
1
2
x
.
x
2
x
12xx
2
; tan(( x+()
In each case differentitate the resultant function to show that it gives the original back. You may need to simplify to get them to look the same. NOTE: a x is the normal algebraic format and means a times x, not a variable ax.
5. Factor the following expression:
image11.wmf
6
x
5
×
y
×
15
x
4
×
y
2
×
+
8
x
4
×
y
×
-
12
x
3
×
y
3
×
-
20
x
3
×
y
2
×
-
36
x
2
×
y
4
×
-
16
x
2
×
y
3
×
+
48
x
×
y
4
×
+
This will factor down to a product of simple terms. If it doesn't you have probably misentered a term. Check them. When you put the cursor on the line, products are clearly indicated. xy is not x times y. This expression DOES factor. If yours doesn’t you have an error, most likely a coefficient.
6. Expand the following expression:
image12.wmf
x
2
y
×
+
(
)
2
3
x
×
4
-
(
)
×
x
3
y
×
-
(
)
×
7. Using Given and Find, solve the following pair of nonlinear equations:
image13.png
Are there more than one set of roots? If so, what are they? Given and Find work well. Remember you have to make guesses. If you are having a problem, see my video on Given and Find.
8. Using the polyroots function solve for the roots of the following polynomial equation:
image14.wmf
2
x
3
×
16
x
2
×
-
31
x
×
+
12
-
=0
The use of polyroots function is shown below
image15.wmf
x
2
x
-
6
-
image16.wmf
f
6
-
1
-
1
æ
ç
ç
è
ö
÷
÷
ø
:=
where this vector defines the coefficients of the equation. The solution is
image17.wmf
polyroots
f
(
)
2
-
3
æ
ç
è
ö
÷
ø
=
You create a vector of the coefficients on the polynomial starting with the constant term and work up from there. Use ctrl M or the matrix pull down menu to generate your 4x1 vector. Then use the polyroots function with the vector or coefficients as the arguments. Polyroots also give complex solutions. Try changing the -16 to -14 and you will get a real and two complex roots.
Hint: if a worksheet is not doing what it is supposed to, it may be because of cross talk with something you did above. Try copying just the problem into a new worksheet. If it works, it is cross talk. Try clearing the variables in the problem. For example to clear x for reuse use the x:=x statement.
DO NOTS:
Only work using one page on a vertical. Do not have two different pages (columns) at the same level. If you do this, I will NOT grade it but return it for resubmission.
If a plot should have three graphs on it, and you only have 1 or 2, I will return the whole assignment ungraded.
If you have jaggies, I will return it. If a curve should be a smooth well behaved function that looks like this
image18.wmf
6
-
4
-
2
-
0
2
4
6
1
-
0.5
-
0
0.5
1
sin
j
(
)
j
and you get something like there, you are seeing jaggies.
image19.png image20.png
These are unacceptable. I have a video on jaggies. Watch it if you are having a problem. If you are still having a problem then, come see me. Do NOT submit an assignment with jaggies. I will return it ungraded.