Create two functions to graph

METBD 050
MathCad3 Handout
Create two functions to graph:
To create a graph region, you need to create the function(s) to graph and the independent range variable. In
the example below, we created f(x) and g(x) as two functions and x as a variable that ranges from -6 to 6.
2
g ( x) := x − 4
these are functions
f ( x) := 2⋅ x + 4
x := −6 .. 6
this is a range variable
Two Functions
20
10
y-axis
f ( x)
g ( x)
6
4
2
0
2
4
6
10
x
x-axis
x =
f ( x) =
g ( x) =
-6
-8
32
-5
-6
21
-4
-4
12
-3
-2
5
-2
0
0
-1
2
-3
0
4
-4
1
6
-3
2
8
0
3
10
5
4
12
12
5
14
21
6
16
32
METBD 050 - MathCad3 - F03.doc
When creating the graph, type in the arguments f(x), g(x), and
x in the placeholders. After typing the f(x), type a comma,
then the g(x) argument to include both functions in the graph.
Right-click on the graph to format it.
Page 1 of 5
METBD 050
MathCad3 Handout
Use a "find block" to find the points of intersection between the line and the
parabola.
Find Block:
1. Guess values of x and y
2. Type the term Given in an EQUATION REGION.
3. Specify the functions. They should both be in terms of the same varaible, x and y in this
case. Be sure to use the Boolean Equal sign: crtl - =.
4. Give any constraints you might need. This is optional.
5. Use the FIND function.
x := 1
y := 2
These are guesses
Given
y = 2⋅ x + 4
Be sure to use the Boolean equal sign
by pressing ctrl - =.
2
y= x −4
This is a constraint that the x-value is to
be greater than zero.
x>0
4
 12 
Use the Find function to find the coordinates of the
intersection of the two functions. In this case, the
solution is (4, 12).
Find ( x , y) = 
Use a "find block" to find the other point of intersection between the point and the parabola.
x := −3
y := 0
These are new guesses
Given
y = 2⋅ x + 4
I copied these regions from above.
2
y= x −4

Find ( x , y) = 
−2

−7
 1.157 × 10

We can check our solutions by substituting the x-values back into the original functions:
f ( −2) = 0
f ( 4) = 12
g ( −2) = 0
g ( 4) = 12
METBD 050 - MathCad3 - F03.doc
Page 2 of 5
METBD 050
MathCad3 Handout
Find the roots of the parabola function using the root function.
Make a guess of x:
x := −1
Use the root function:
root ( g ( x) , x) = −2
Make another guess for x:
x := 2
Use the root function:
root ( g ( x) , x) = 2
So, it is clear that y = 0 when x = -2 and when x = 2.
Find the minimum value of the function g(x):
x := 1
a guess for x
Given
2
g ( x) = x − 4
minx := Minimize ( g , x)
minx = 0
this gives the x-value for which g(x) is a minimum
g ( 0) = −4
which is the minimum value of the function
Use the Maximize function when finding the maximum value of a function.
METBD 050 - MathCad3 - F03.doc
Page 3 of 5
METBD 050
MathCad3 Handout
Use of Symbolic Operators
Use the solve operator to rearrange an equation, solving for a different variable:
3
3
P⋅ L
1
L
∆=
solve , I →
⋅ P⋅
48⋅ E⋅ I
48 ∆ ⋅ E
This function rearranges the given equation, solving for I
Use the solve operator to find the value of a variable:
3 
4 
2
z − 7z + 12 = 0 solve , z → 
OR
3 
4 
( z − 3) ⋅ ( z − 4) = 0 solve , z → 
In this case, be sure to use the Boolean equal sign (crtl - =) when creating the equation. In the placeholder
after the word solve, type the variable you want to solve for. In this example, z = 3 or z = 4 solves the
equality.
Use the factor operator to factor terms:
2
z − 7z + 12 factor → ( z − 3) ⋅ ( z − 4)
ANOTHER EXAMPLE
2
2⋅ π ⋅ r + 2⋅ π ⋅ r⋅ L factor → 2⋅ r⋅ π ⋅ ( r + L)
The factor operator comes with a placeholder. Delete the placeholder to get the results shown above.
Use the expand operator to work backwards from a factor operation:
2
( z − 3) ⋅ ( z − 4) expand → z − 7⋅ z + 12
List the coefficients of the variable z in the polynomial:
 12 
z − 7⋅ z + 12 coeffs , z →  −7 
1
 
2
METBD 050 - MathCad3 - F03.doc
Page 4 of 5
METBD 050
MathCad3 Handout
Calculus Applications:
Use calculus to determine the minimum value of the parabola plotted on the first page of this document. We
will be using a different variable since x has been used above. The k-coordinate is found by setting the first
derivative of the function equal to zero and solving for k.
(
)
d
2
k − 4 → 2⋅ k
dk
the first derivative of the function is 2k
2⋅ k = 0 solve , k → 0
set the first derivative to 0 and solve for k
2
h ( k) := k − 4
h ( 0) = −4
find the value of the minimum by
substituting the value of k into the function
The coordinate of the minimum point on the parabola is (0, -4)
Use calculus to determine the area defined by the function y = x/5 + 4, the x-axis, and the x-coordinates
0 and 5 as shown shaded in the figure below.
y = x/5 + 4
5
area
NOTE: This is a figure
drawn in Word and pasted
into MathCad.
0
0
5
5
⌠ x

+ 4 dx = 22.5
 5
⌡0
The area under the curve is 22.5 square units.
Checking:
f ( x) :=
x
+4
5
f ( 0) = 4
4+5
( 5) = 22.5
2
METBD 050 - MathCad3 - F03.doc
f ( 5) = 5
Checks
Page 5 of 5