You are on page 1of 12

EXAMPLES USING MATHCAD 14

Basic Operations:
2 2 4

Type the = sign to get a result.

58 96 38

123 567.58 69812.34


144 12
12
Note that you may use parenthesis in the usual ways. Many operators are
available in the calculator menu.

Assigning variables use : to get the assignment operator. Use = to get a result.

a 4

b
56

a b 224

a 2 b 2 56.143
Greek letters can be used from the "Greek" menu.

12

r 10

Area r

Area 314.159
A simple assignment statement can be use to create a function.
2

f (x) x 4

f (4) 20
f (3) 13

The graph of f:

Graph of y=f(x)
20
15
f( x) 10
5
0
4

The range of x was specified on the graph as [-4,4].


You may have better control by specifying the range of a graphing variable.
t 10 9.9 10

120
100
80
f( t)

60
40
20
0
10

0
t

10

0.5

cos(t)

0.5
1
10

10

Summation Examples
n

10

n(n 1)

i 1

(n 1) 2

1
2

simplify

n(n 1)
2

i 55

i 1

1
1

10

i
i 1 1)

n ( n 1) (2 n

i 385

i 1

Infinite sums must be evaluated symbolically.

0.5k

k 0

Mathcad cannot evaluate this without overflow.

0.5 2.0

BUT...Mathcad can evaluate this


symbolically..


if

pk

k 0

k 0

if p 1 p 1

p 1

1 z

if

ln (1
z)

k 1

k 1

1 p

(n 1)

if z 1 z 1

n
4

Or evaluate a specific case:

100

k3 25502500

k 1

Finite Harmonic Sum:

Next

Must have |p|<1 for convergence.

10

k 1

1
k

2.929

n(n 1) (n

[k(k 1)]

2) 3

k 1

Usually with Mathcad we don't use the formula. We would evaluate:


20

[k(k 1)] 3080

k 1

Use symbollic evaluation for infinite sums and numerical evaluation for finite sums unless
you are trying to get a "formula" in the finite case.

Power Series
Consider the power series

1
k

1
x


ln 1 x

k 1

k
3

To determine the radius of convergence:


k1

1
x

lim
k

k 1 3

1 x
k 3

thus, converges for |x|<3.

Permutations
Click on f(x) in the toolbar to find the permut function. permut(n,k) is
the number of orderings of n things taken k at a time when n and k
are both positive with k<= n.
permut(5 1) 5
same as 5 to the 1 falling
permut(5 2) 20
same as 5 to the 2 falling
permut(5 4) 120
same as 5 to the 4 falling
permut(5 5) 120
same as 5 to the 5 falling or 5 factorial.
Combinations
Click on f(x) in the toolbar to find the combin function. combin(n,k) is
the number of ways that k things can be chosen from n things when
0<=k<=n.

combin(5 0) 1
combin(5 1) 5

combin(52 5) 2598960
which is the number of ways to draw 5 cards from 52.

combin(5 2) 10

combin(5 3) 10
combin(5 4) 5
combin(5 5) 1

Examples of symbolic derivatives using arrow operator.

(y z) (y z)

As symbolic evaluation Mathcad cannot improve on this.

The expand command produces the binomial expansion in this instance. See the
symbolic table.
5

(y z) expand

3 2

2 3

y 5 y z 10y z 10y z 5 y z z

Mathcad 13 required a variable to be primary:


5

(y z) expand z

3 2

2 3

y 5 y z 10y z 10y z 5 y z z

Derivative at a particular value of the dependent variable.


x 3
d
dx

f (x) 6

A symbolic derivative using shift+F9.

x2 4

dx

2 x

Notice the answer appears below with NO equal sign or arrow.

A symbolic derivative using evaluation menu arrow.

2
d
x
dx
4

G
i

v
e

s a particular value because x is already defined. Will


evaluate symbollically if x not defined.

z2 42 z

dz

d
sin(z) cos(z)
dz
2

d
dz

tan(z) tan(z ) 1

z
d z
e e
dz
sin(z)
d sin(z)
e
cos(z)
e
dz

Evaluate indefinite integrals (add a constant).

9
x dx + C
2

3 sin (3)
+C
3 cos(x) sin(x) dx
2

Notice that you must type sin(x) as a funciton - not sinx.

e x2
erf (3i) i

+
dx
2
C

Evaluate definite integrals.

You can get "complex" answers, but not in


problems for this class.

Answer obtained with standard = sign.

x x dx
21.961

7
x 1
dx 0.981
2
x 8

Solve a quadratic equation.

Given
2

2x 4x 30 = 0
Note that you MUST use the boolean = sign.
Find(x) (
3

5 ) Values given in matrix row.

Notice that Find(x) is a function listed under f(x) above.


Now try a cubic.
Given
3

2x 2x 28x 48 = 0
Find(x) (
2

4 3 )

2x 2x 28x 48 = 0 solve x

Notice this approach does not work if x has been previously defined to have a value. (It's ok to
use x within a given block, however.) So we'll change the variable.
3

2w 2w 28w 48 = 0 solve w

4
3

Polynomial multiplication:

(w 1) (w 2) (w 3)
expand

w 6

11w 6

Factoring:
3

2 11w 6 factor (w 3) (w 1) (w 2)

(w 5) (w 7)
expand

12w 35

w 12w 35 factor (w 5) (w 7)

Integer factoring:
1024 factor 210
1935 factor 3 2 5 43
17 factor

17

This one is prime.

You might also like