Sie sind auf Seite 1von 10

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

2 2
a + b = 56.143

Greek letters can be used from the "Greek" menu.


λ := 12 r := 10

2
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

0
−4 −2 0 2 4
x

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 −5 0 5 10
t
1

0.5

cos( t) 0

− 0.5

−1
− 10 −5 0 5 10
t

Summation Examples
n 10
n ⋅ ( n + 1)
∑ i→
2 ∑ i = 55
i= 1 i= 1

1 2 1 1 n ⋅ ( n + 1)
⋅ ( n + 1) − ⋅n − simplify →
2 2 2 2

n 10
n ⋅ ( n + 1) ⋅ ( 2 ⋅ n + 1)
∑ ∑
2 2
i → i = 385
6
i= 1 i= 1

Infinite sums must be evaluated symbolically.

⎛ ∞ ⎞
⎜ 0.5 ⎟ =

k
⎜ ⎟ Mathcad cannot evaluate this without overflow.
⎝k = 0 ⎠


k BUT...Mathcad can evaluate this
0.5 → 2.0
symbolically..
k = 0


k
p → ∞ if 1 ≤ p
k = 0 1 Must have |p|<1 for convergence.
− if p ≠ 1 ∧ p < 1
p− 1

∞ k


z z
→e
k!
k = 0

∞ k


z
→ ∞ if 1 ≤ z
k
k = 1 −ln ( 1 − z) if z ≠ 1 ∧ z ≤ 1

n 2 2
n ⋅ ( n + 1)

3
k →
4
k = 1

Or evaluate a specific case:

100


3
k = 25502500
k = 1

Finite Harmonic Sum:

10


1
= 2.929
k
k = 1

Next
n
n ⋅ ( n + 1) ⋅ ( n + 2)
∑ [k ⋅ ( k + 1)] →
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 ⎞ ⎛ x ⎞ k⎤
⎢⎜ ⎟ ⋅ ⎜ ⎟ ⎥ → −ln ⎛⎜ 1 − 1 ⋅ x⎞⎟
∑ ⎣⎝ k ⎠ ⎝ 3 ⎠ ⎦ ⎝ 3 ⎠
k = 1

To determine the radius of convergence:

k+1
⎛ 1 ⎞ ⋅⎛ x ⎞
⎜ ⎟⎜ ⎟
lim
⎝k+ 1⎠ ⎝3⎠

x
thus, converges for |x|<3.
k→∞ k 3
⎛ 1 ⎞ ⋅⎛ x ⎞
⎜ ⎟⎜ ⎟
⎝ k⎠ ⎝ 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
combin ( 5 , 2 ) = 10 which is the number of ways to draw 5 cards from 52.

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

Expansion
5 5
( 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 5 4 3 2 2 3 4 5
( y + z) expand → y + 5 ⋅ y ⋅ z + 10 ⋅ y ⋅ z + 10 ⋅ y ⋅ z + 5 ⋅ y ⋅ z + z

Mathcad 13 required a variable to be primary:


5 5 4 3 2 2 3 4 5
( y + z) expand , z → y + 5 ⋅ y ⋅ z + 10 ⋅ y ⋅ z + 10 ⋅ y ⋅ z + 5 ⋅ y ⋅ z + z

Derivative at a particular value of the dependent variable.

x := 3

d
f ( x) = 6
dx

A symbolic derivative using shift+F9.

d (2
x +4 )
dx

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

A symbolic derivative using evaluation menu arrow.

d 2(
x +4 →6 ) Gives a particular value because x is already defined.
Will evaluate symbollically if x not defined.
dx

Examples of symbolic derivatives using arrow operator.


d 2(
z + 4 → 2 ⋅z )
dz

d
sin ( z) → cos ( z)
dz

d 2
tan ( z) → tan ( z) + 1
dz

d z z
e →e
dz

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

Evaluate indefinite integrals (add a constant).

⌠ 9
⎮ x dx → +C
⌡ 2

⌠ 3 ⋅ sin ( 3 )
2
⎮ 3 cos ( x ) sin ( x ) dx → +C
⌡ 2

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


⎮ x
2
π ⋅ erf ( 3i) ⋅ i
⎮ e dx → − +C
⌡ 2
You can get "complex" answers, but not in
problems for this class.

Evaluate definite integrals.


5

⎮ x x dx = 21.961 Answer obtained with standard = sign.

1

7
⌠ x+1

dx = 0.981
⎮ 2
⎮ x +8

2

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 2
2x − 2x − 28x + 48 = 0

Find ( x ) → ( 2 −4 3 )

As an alternative you can use the solve function from the symbolic toolbar.
3 2
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.

⎛2 ⎞
2w − 2w − 28w + 48 = 0 solve , w → ⎜ −4 ⎟
3 2
⎜ ⎟
⎝3 ⎠
Polynomial multiplication:

3 2
( w − 1 ) ⋅ ( w − 2 ) ⋅ ( w − 3 ) expand → w − 6 ⋅ w + 11 ⋅ w − 6

Factoring:
3 2
w − 6w + 11w − 6 factor → ( w − 3 ) ⋅ ( w − 1 ) ⋅ ( w − 2 )

2
( w − 5 ) ⋅ ( w − 7 ) expand → w − 12 ⋅ w + 35

2
w − 12 ⋅ w + 35 factor → ( w − 5 ) ⋅ ( w − 7 )

Integer factoring:

10
1024 factor → 2

2
1935 factor → 3 ⋅ 5 ⋅ 43

17 factor → 17 This one is prime.

Das könnte Ihnen auch gefallen