Computer MODULE Introduction To MathCad (MathCad Organization)
Computer MODULE Introduction To MathCad (MathCad Organization)
MODULE 3
Introduction to Mathcad
(Mathcad Organization)
MODULE 3: MATHCAD
▪ WHAT IS MATHCAD ?
You can type any equation like how they are written on a paper. Simply type
your equations and Mathcad will provide you instant result, along with as much
text as you want to accompany the math. You can use Mathcad equations to solve
both symbolical and numerical equations. You can place text anywhere on the
worksheet and add two- or three-dimensional graphs to the worksheet.
Additionally, you may even illustrate your work with other images taken from
another application.
Mathcad lets you simply mix and convert between different unit systems.
You can work in your preferred unit system or switch to another system. You can
trace unit mistakes by checking your worksheets for dimensional consistency.
DISCLAIMER. The sample PTC Mathcad 14 in this module is to provide the reader
with knowledge of how Mathcad may be used in this subject and for future
references. Before using the worksheets in this application, the reader should
understand the content and usage of said application.
Mathcad Icon
When you open Mathcad, you see the interface like that shown in Figure
3-1. The MathCAD workspace is considerably different from most “spreadsheet
style” data analysis program (like Excel). Equations, data tables, graphs and
descriptive text can all be combined in one MathCAD document, making this
software particularly handy for application development.
▪ MATHCAD FILE
Figure 3-2. Creating new Mathcad file from the File Menu Tab and the New Worksheet Dialogue
Box.
▪ MATH TOOLBAR
Each button in the Math toolbar or Math Palette opens another toolbar of
operators or symbols.
This Math Palette contains all the sub toolbars such as calculator, graph,
matrix, evaluation, Boolean, programming, Greek symbol and symbolic keyword
palette (see figure 3-3).
▪ STANDARD TOOLBAR
▪ FORMATTING TOOLBAR
The Formatting toolbar contains scrolling lists and buttons to specify font
characteristics for both equations and text.
NOTE:
▪ To know what the name and function of a button on any toolbar is, hover
the mouse cursor over the button until a tooltip appears beside with a
brief description.
▪ You can choose to show or hide any toolbar from the View Menu. To
detach and drag a toolbar around your window, place your cursor on the
edge of the toolbar on the left where a. Then hold down the mouse button
and drag.
▪ You can customize the Standard and Formatting toolbars. To hide, add
and remove buttons, right click on the toolbar, and choose Customize
from the menu to display Customize Dialogue Box.
▪ REGION
Mathcad allows you to enter text, equations, and plots anywhere in the
worksheet. Each piece of text, equation, or other element is known as a region. A
Mathcad worksheet is a collection of such regions.
1. Click anywhere in a blank area of the worksheet. You see a small crosshair.
Anything you type appears at the crosshair (see figure 3-6).
2. If the region you want to create is a math region, just start typing anywhere you
put the crosshair. By default, Mathcad understands what you type as a
mathematical language see figure 3-6 for example.
3. To create a text region, (option 1) click Insert Menu and select Text Region,
(option 2) just click anywhere the worksheet and start typing or (option 3) simply
press [“] and then start typing.
Figure 3-6. Example of simple calculation and image for cursor in Mathcad.
• Once an equation is on the screen, you can edit it by clicking in it and typing
new letters,
numbers, or operators.
ADDITIONAL INFORMATION:
▪ The Properties Dialogue Box will display, click on the Display tab and
click the check box beside “Highlight Region” and “Show Border” (see
figure on right) and click OK.
Mathcad’s power and versatility quickly become apparent once you begin to
use variables and functions. By defining variables and functions, you can link
equations together and use intermediate
results in further calculations regions.
You cannot directly edit what appears to the right of the [=]. You can, however,
change the format or units in which the numbers are displayed.
FORMATTING A RESULT
3. To affect symbolic results, be sure to click the check box near "Apply to
symbolic results."
Evaluates the variables on the right side and assigns the result to the left side
(see figure 3-10).
The left side of the equation is any valid Mathcad variable or function name,
matrix of names, or subscripted variable name but never a numerical value. The
right side of the equation is any Mathcad expression that can be evaluated. If you
used an invalid let variable or function name on both sides, or suffers from other
syntax problems, you will see an appropriate error message. The Mathcad is also
configured to highlight the mistake in the equation to help the user re-check his
work.
When you evaluate an expression with the symbolic equal sign, Mathcad
simplifies the result by performing arithmetic and combining like variables (see
example #4 on Figure 3-11).
1. 2.
3.
4.
From example #3 and Figure 3-12, both solutions gave us the same result.
Mathcad really helps the users to compress lengthy solution.
INSERTING A KEYWORD
To perform more complex symbolic operations, you can insert a keyword that
specifies the operation before the symbolic equal sign.
2. Press Ctrl + Shift + . to insert a placeholder (see figure 3-8) for the keyword,
followed by the symbolic equal sign.
You can use "explicit" to force Mathcad to temporarily ignore the assigned value
of a variable. For example in Scenario 4, suppose you have previously assigned
x the value 4 and then try to factor the polynomial 𝒙𝟐 − 𝟒𝒙 + 𝟒: (see Scenario 2)
Mathcad first substitutes 4 for x in the polynomial to get 4 as a result, and then
factors 4 over the integers to get 𝟐𝟐 .
If instead you want to factor the polynomial without substituting assigned value x
= 5, use the keyword "explicit" before "factor" to suppress the value of x in a
single symbolic evaluation, as shown in the Scenario 4:
The following lists the keywords and the operations they perform (see
Symbolic Tab in figure 3-3):
KEYWORDS OPERATIONS
transforms:
Fourier, Evaluate the transform or inverse transform of a function.
Laplace, and Z
Global definitions work exactly like local definitions except that they are
evaluated before any local definitions. If you define a variable or function with a
global definition, that variable or function is available to all local definitions in your
worksheet, regardless of whether the local definition appears above or below the
global definition.
y←x
AVERAGE GRADE
99-100 1.00
95-98 1.25
90-94 1.50
85-89 1.75
80-84 2.00
75-79 2.25
70-74 2.50
65-69 2.75
60-64 3.00
Below 60 5.00
Another example, the local assignment operator may also be used within a
program. Figure 3-16 shows that when input numerical values of “x”
satisfies one of the listed condition, the program is configured to return a
corresponding result with the use of local assignment operator (←).
▪ MATRICES
But, in Mathcad, this the 1st row A00 A01 A02 .. A0n
and column are configured to be A10 A11 A12 .. A1n
row number 0 and column number A= A20 A21 A22 .. A2n
0. In that sense, the only : : : :
difference is that the counting will am0 am1 am2 .. amn
simply start from 0 and not 1
(see matrix beside).
In figure 3-17, to find the specific elements Q00, Q11, and Q11 we have to
use the (option 1) Matrix Toolbar for the subscript or the (option 2)
subscript button of the standard toolbar found the right side, then the equal
sign and enter. Know that the 1st value corresponds to element Q00.
▪ 2-DIMENSIONAL PLOTTING
A typical polar plot shows angular values, θ, versus radial values, r. Figure 3-
18 shows several examples of 2D plots.
1. Define a range variable (see explanation form previous topic) for the range
of values over which to plot the expression, for example: a := 5, 3 .. -7, if
not listed, the Mathcad will define all values that can be plotted (see
example below).
2. From the Insert menu, click Graph > X-Y Plot, or type @ for its shortcut
key, to create an x-y plot operator.
3. In the middle placeholder along the x-axis (horizontal axis), enter the
range variable.
Figure 3-19. Alternate solution for the graph of the example 2-Dimensional Plotting using
Differential Calculus
1
2𝑥 − 1 = 0; 𝑥 =
2
𝟏
𝒙 − 𝒊𝒏𝒕𝒆𝒓𝒄𝒆𝒑𝒕 ( , 𝟎)
𝟐
3. Locate the points where 𝒚′ = 𝟎 and determine the maxima and minima.
3.1 Differentiate
𝑦′ = 𝟑(2𝑥 − 1)𝟑−𝟏 (𝟐)
𝒚′ = 𝟔(𝟐𝒙 − 𝟏)𝟐
3.4 Solve for the Critical Points, CP. Substitute the roots in the given
function.
3
1 𝟏
𝑦 = [2 ( ) − 1] = 𝟎; 𝑪𝑷 ( , 𝟎)
2 𝟐
4. Locate the points where 𝒚′′ = 𝟎 (𝒑𝒐𝒊𝒏𝒕𝒔 𝒐𝒇 𝒊𝒏𝒇𝒍𝒆𝒄𝒕𝒊𝒐𝒏, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒔𝒆𝒔) and
draw the tangent at each of those points.
4.1 Differentiate
𝑦′ = 6(2𝑥 − 1)2
𝑦 ′′ = 6(𝟐)(2𝑥 − 1)𝟐−𝟏 (𝟐)
𝒚′′ = 𝟐𝟒(𝟐𝒙 − 𝟏)
4.4 Solve for the Points of Inflection. Substitute the roots in the given
function.
3
1 𝟏
𝑦 = [2 ( ) − 1] = 0; 𝑷𝑶𝑰 ( , 𝟎)
2 𝟐
4.5 Concavity
by 𝟐𝒏𝒅 𝐃𝐄𝐑𝐈𝐕𝐀𝐓𝐈𝐕𝐄 𝐓𝐄𝐒𝐓
Substitute CP in𝑦′′.
𝟏
@𝑪𝑷 ( , 𝟎)
𝟐
1
𝑦 ′′ = 24 [2 ( ) − 1] = 0
2
if y ′′ = 0, , the test fails
It says 𝒏𝒐𝒕𝒉𝒊𝒏𝒈 about the concavity.
1 1 1 1 5
𝒙 0 1 − 𝑜𝑟 − 0.25 𝑜𝑟 1.25
2 2 2 4 4
27 27
𝒚 0 −1 0 0 1 − 𝑜𝑟 − 3.38 𝑜𝑟 3.38
8 8
Example 2: Find the equations of the tangent and the normal at the point
indicated. Sketch the curve.
𝟏 𝟏 𝟏 𝟏𝟏
𝒚 = 𝒙𝟑 − 𝒙𝟐 − 𝟐𝒙 + 𝟐 𝒂𝒕 ( , )
𝟑 𝟐 𝟐 𝟏𝟐
1 1
𝑦′ = (𝟑𝑥 𝟑−𝟏 ) − (𝟐𝑥 𝟐−𝟏 ) − 2𝑥 𝟏−𝟏 + 0
3 2
𝒚′ = 𝒙 𝟐 − 𝒙 − 𝟐
1 2 1
𝑚 = 𝑦′ = ( ) − ( ) − 2
2 2
−𝟗
∴𝒎= = 𝒎𝑻𝑳
𝟒
1 1
𝒘𝒉𝒆𝒏 𝒙 → −∞ 𝑠𝑎𝑦 − 1,000; 𝑦 = (−1000)3 − (−1000)2 − 2(−1000) + 2
3 2
𝒚 → −∞
3. Locate the points where 𝒚′ = 𝟎 and determine the maxima and minima.
3.1 Differentiate
1 1
𝑦′ = (𝟑𝑥 𝟑−𝟏 ) − (𝟐𝑥 𝟐−𝟏 ) − 2𝑥 𝟏−𝟏 + 0
3 2
𝒚′ = 𝒙𝟐 − 𝒙 − 𝟐
3.4 Solve for the Critical Points, CP. Substitute the roots in the given function.
1 1 𝟏𝟗 𝟏𝟗
𝑦 = (−1)3 − (−1)2 − 2(−1) + 2 = ; 𝑪𝑷𝟏 (−𝟏, )
3 2 𝟔 𝟔
1 1 −𝟒 −𝟒
𝑦 = (2)3 − (2)2 − 2(2) + 2 = ; 𝑪𝑷𝟐 (𝟐, )
3 2 𝟑 𝟑
𝟏𝟗
@𝑪𝑷𝟏 (−𝟏, )
𝟔
𝑡𝑟𝑦 𝒙𝒍𝒐𝒘𝒆𝒓 = −𝟐 𝑎𝑛𝑑 𝒙𝒉𝒊𝒈𝒉𝒆𝒓 = 𝟎
𝑦 ′ = (−2)2 − (−2) − 2 = +4
𝑦 ′ = (0)2 − (0) − 2 = −2
−𝟒
@ 𝑪𝑷𝟐 (𝟐, )
𝟑
𝑡𝑟𝑦 𝒙𝒍𝒐𝒘𝒆𝒓 = 𝟏 𝑎𝑛𝑑 𝒙𝒉𝒊𝒈𝒉𝒆𝒓 = 𝟑
𝑦 ′ = (1)2 − (1) − 2 = −2
𝑦 ′ = (3)2 − (3) − 2 = +4
4. Locate the points where 𝒚′′ = 𝟎 (𝒑𝒐𝒊𝒏𝒕𝒔 𝒐𝒇 𝒊𝒏𝒇𝒍𝒆𝒄𝒕𝒊𝒐𝒏, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒔𝒆𝒔) and
draw the tangent at each of those points.
4.1 Differentiate
𝑦′ = 𝑥 2 − 𝑥 − 2
𝑦′′ = 𝟐𝑥 𝟐−𝟏 − 𝑥 𝟏−𝟏 − 0
𝒚′′ = 𝟐𝒙 − 𝟏
4.2 Set 𝑦 ′′ = 0
𝟎 = 𝟐𝒙 − 𝟏
4.4 Solve for the Points of Inflection. Substitute the roots in the given
function.
1 1 3 1 1 2 1 𝟏𝟏 𝟏 𝟏𝟏
𝑦 = ( ) − ( ) − 2( ) + 2 = ; 𝑷𝑶𝑰 ( , )
3 2 2 2 2 𝟏𝟐 𝟐 𝟏𝟐
4.5 Concavity
by 𝟐𝒏𝒅 𝐃𝐄𝐑𝐈𝐕𝐀𝐓𝐈𝐕𝐄 𝐓𝐄𝐒𝐓
Substitute CP in𝑦′′.
𝟏𝟗
@𝑪𝑷𝟏 (−𝟏, )
𝟔
𝑦 ′′ = 2(−1) − 1 = −3
−𝟒
@ 𝑪𝑷𝟐 (𝟐, )
𝟑
𝑦 ′′ = 2(2) − 1 = 3
𝟏 𝟑 𝟏 𝟐
𝒚= 𝒙 − 𝒙 − 𝟐𝒙 + 𝟐
𝟑 𝟐
1
𝒙 0 −1 2 1 −2 −2.75 2.75
2
19 −4 11 −1 4
𝒚 2 −3.21 −0.35
6 3 12 6 3
Figure 3-21. Alternate solution for the graph of the example 2-Dimensional Plotting using
Differential Calculus
Click Insert Menu Tab and select (option 1) Unit to display Insert Unit Dialogue
box and see a list of currently available units or click its shortcut key Ctrl + U on
the keypad (see figure 3-22).
MODULE 4
Introduction to Mathcad
(Mathcad Programming)
It is a great way to reduce the work and time necessary when a mathematical
process has to be
performed multiple times in a worksheet.
SHORTCUT DESCRIPTION
KEYS
It offers the option to open find dialog box quickly. You can
Ctrl + F
also use Shift + F5 for it.
It offers users the option to open the dialog box where you
Ctrl + O
can choose a file that you want to open.
CALCULATOR
TOOLBAR
= To evaluate numerically
/ Division
‘ To insert parenthesis
BOOLEAN
TOOLBAR
Ctrl + ! or Ctrl +
¬ Boolean NOT
Shift + 1
Ctrl + % or Ctrl +
⊕ Boolean XOR
Shift + 5
Ctrl + ^ or Ctrl +
v Boolean OR
Shift + 6
CALCULUS
TOOLBAR
d
? f(x) Derivative
dx
Ctrl + ? or Ctrl + 𝑑𝑛
f(x) Derivative
Shift + / 𝑑𝑥 𝑛
b
& or Shift + & ∫a f(x)dx Definite integral
Ctrl + # or Ctrl +
Shift + 3
= Iterated product
# or Shift + 3
Iterated product with range variables
sin (x)
Ctrl + L lim Two-sided limit
x→0 x
n
Ctrl + $ or Ctrl +
∑ xi Summation
Shift + 4
i=1
$ or Shift + 4 ∑ xi Summation
𝑖=1
EVALUATION
TOOLBAR
= = means Evaluation
MATRIX
TOOLBAR
Ctrl + 1 Transpose
Ctrl + 6 Column
; Range variable
Ctrl + - Vectorize
PROGRAMMING
TOOLBAR
] Add line
Ctrl + [ Continue
Ctrl + “ or Ctrl +
For
Shift + ‘
} or Ctrl + Shift + If
]
Ctrl + ‘ On error
Ctrl + ] While
SYMBOLIC
TOOLBAR
DISCLAIMER. The sample Mathcad images in this module are to provide the
reader with examples of how Mathcad may be used in calculation from simple to
complex problems. Before using the worksheet in this module, the reader should
understand the operations and functions of the Mathcad application and carefully
verify that the application (1) are applicable to his or her problem situation and (2)
produce an acceptable answer. The reader assumes all risks from the use and/or
performance of these application.
5. for ■ 𝝐 ■ - It is a looping operator which can be used when you know how many
times you want a
program statement to be executed repeatedly.
6. while ■ - It is a looping operator which can be used when you want to stop
execution of a statement
■ upon the occurrence of a condition but don't know exactly when the
condition will occur.
7. break – It is a control operator which can be used when you want to break out
of a loop upon the occurrence of some condition and which moves execution
to next statement outside the loop.
8. continue - It is a control operator which can be used when you want to halt
current iteration of a loop upon the occurrence of a condition and force program
to continue next iteration of a loop.
10. ■ on error ■ - It is an operator for error control which can be used to return an
alternative value when an error happened in an expression
Where:
z is a real or complex scalar or vector. For the lowercase functions, z must
be dimensionless.
n is an integer.
Both program and synthetic calculator gave the same result for
Pair No. 1. Therefore, the program really worked.
Option 1: Press Ctrl + Shift + . and type the keyword "coeffs" in the placeholder
after the polynomial. Then, press Enter.
Option 2: Click “coeffs” on the Symbolic toolbar and type the polynomial
before the keyword. Then, press Enter.
Figure 4-3. Using Mathcad to know the coefficients and degree (exponents).
If the polynomial contains more than one variable, type a comma after
"coeffs" followed by the variable with respect to which you want the coefficients
expressed. For an expression containing several variables, Mathcad internally
writes the expression as a polynomial in the variable you specify after "coeffs".
The coefficients are expressions involving the variables other than the one you
specify.
If the expression contains more than one variable, you must specify a
variable after "coeffs." Mathcad internally rewrites the expression as a polynomial
in that variable and returns a vector containing the coefficients of the polynomial.
For example,
Option 1: Press Ctrl + Shift + . and type the keyword "collect" in the
placeholder after the polynomial. Then, press Enter.
Option 2: Click “collect” on the Symbolic toolbar and type the polynomial
before the keyword. Then, press Enter.
Mathcad adds the terms 5y2 + 3y, containing the term x2, and the terms 3x2
+ y, containing the term x. Furthermore, on the second program, Mathcad adds
the terms 5x2 + 7x, containing the term y2, and the terms 3x2 + x, containing the
term y. See figure 4-4 for example.
IF
(Ctrl + Shift + [ or Ctrl + {)
OTHERWISE
(Ctrl + Shift + ] or Ctrl + })
In the following example (see figure 4-5), the function returns true value 0
if absolute value of x is greater than 10 or less than −10. When x is between −10
and 10, the function returns the false value square root of x2.
Another example (see figure 4-6), it is a program that may be used to solve
for the factorial of a number. Factorial (n) is programmed that if the input value for
variable n is 1, the program will return a result of 1, else, any other number will be
evaluated by the expression on the otherwise operator.
Know that the factorial of 3 is 1∙2∙3 = 6. With that, the program is checked.
Scenario 3: With the same concept in Scenario 2, all defined values using a global
definition for variable k supersede all variables with the same name (see 3rd and
5th line of solution in scenario 3 on figure 4-8). But when you declared a numerical
value for “k” (see 4th and 6th line of solution on figure 4-8), Mathcad is configured
to evaluate that function with the declared numerical and return its corresponding
result.
A matrix can only be added to (or subtracted from) another matrix if the two
matrices have the same dimensions. Say, MatA + MatB := [MatAij + MatBij]. See
figure 4-9 for example.
▪ Multiplication
Finding the product of two matrices is only possible when the inner
dimensions are the same, meaning that the number of columns of the first
matrix is equal to the number of rows of the second matrix. See figure 4-10.
▪ Transpose of a Matrix
▪ Determinant
For example,
1 −1 2
Find the determinant of given matrix A = [1 −2 3].
2 −2 1
Solution:
(-)
1 −1 2 𝟏 −𝟏
det A = │A│ = [1 −2 3] 𝟏 −𝟐
2 −2 1 𝟐 −𝟐
(+)
│A│ = (1 ∙ −2 ∙ 1) + (−1 ∙ 3 ∙ 2) + (2 ∙ 1 ∙ −2) − (2 ∙ −2 ∙ 2) − (−2 ∙ 3 ∙ 1)
− (1 ∙ 1 ∙ −1)
│A│ = −2 − 6 − 4 + 8 + 6 + 1
∴ │𝐀│ = 𝟑
See figure 4-12 for an alternative solution using the application and the topic’s
concept.
From figure 4-12, we can see a simpler solution that eliminates the lengthy
solution for the computation of a determinant. It only needs the correct
arrangement of data that the application can comprehend with the help of right
use of operators.
We can also evaluate if the answer is correct if we will refer back to the concept
behind the solution of a 3 x 3 matrix. Another way to check the result is through
calculator technique but the limitation is that the given matrix size should be one
of the syntax saved in the calculator’s program (see figure 4-13).
Step 1: Click Mode, Step 2: Choose any Step 3: Choose size of Step 4: This will be
choose 6. matrix where to save matrix. The given matrix the setup of the
your data. Say choose size is 3x3. Therefore, calculator thereafter.
1. choose 1.
Step 5: Enter the Step 6: Click AC. The Step 7: Click Shift, 4, 7 Step 8: Click Shift, 3.
given data by data was already to perform and The number 3 pertains
typing the values stored in the calculate the to the matrix where
then click = key. calculator. determinant. you choose to store
your data at Step 2.
Click = to show the
result.
In linear algebra, the Rule of Sarrus is a mnemonic device for computing the
determinant of a 3 x 3 matrix named after the French mathematician Pierre
Frédéric Sarrus.
For example,
a11 a12 a13
A = [a21 a22 a23 ]
a31 a32 a33
𝑎 𝑎13
|M31 | = |𝑎12 𝑎23 | is the minor of a31.
22
𝑎12 𝑎13
C31 = (−1)3+1 |M31| → C31 = (−1)4 |𝑎 𝑎23 |
22
𝑎12 𝑎13
C31 = |𝑎 | is the cofactor of a 31.
22 𝑎23
▪ Laplace Expansion
For example,
1 2 −3 4
Find the determinant of given matrix A = [ −4 2 1 3 ].
3 0 0 −3
2 0 −2 3
Solution:
2 1 3 2 1
|A| = (1)(−1)2 |0 0 −3| 0 0
0 −2 3 0 −2
−4 1 3 −4 1
+ (2)(−1)3 | 3 0 −3| 3 0
2 −2 3 2 −2
−4 2 3 −4 2
4
+ (−3)(−1) | 3 0 −3| 3 0
2 0 3 2 0
−4 2 1 −4 2
+ (4)(−1)5 | 3 0 0 | 3 0
2 0 −2 2 0
∴ |𝐀| = 𝟒𝟖
2 1 3 2 1
|A| = (1)(−1)2 |0 0 −3| 0 0
0 −2 3 0 −2
2 −3 4 2 −3
( )( ) 3|
+ −4 −1 0 0 −3| 0 0
0 −2 3 0 −2
2 −3 4 2 −3
+ (3)(−1)4 |2 1 3| 2 1
0 −2 3 0 −2
2 −3 4 2 −3
5
+ (2)(−1) |2 1 3 |2 1
0 0 −3 0 0
∴ |𝐀| = 𝟒𝟖
−4 1 3 −4 1
|A| = (2)(−1)3 | 3 0 −3| 3 0
2 −2 3 2 −2
1 −3 4 1 −3
( )( ) 4|
+ 2 −1 3 0 −3| 3 0
2 −2 3 2 −2
1 −3 4 1 −3
+ (0)(−1)5 |−4 1 3| −4 1
2 −2 3 2 −2
1 −3 4 1 −3
( )( ) 6|
+ 0 −1 −4 1 3 | −4 1
3 0 −3 3 0
∴ |𝐀| = 𝟒𝟖
See figure 4-15 for an alternative solution using the application and the topic’s
concept.
From figure 4-15, we can see a simpler solution that eliminates the
lengthy solution for the computation of the determinant of a 4 x 4 matrix. It only
needs the correct arrangement of data that the application can comprehend with
the help of right use of operators.
We can also evaluate if the answer is correct if we will refer back to the concept
behind the solution of a 4 x 4 matrix.
▪ Adjoint of a Matrix
For example,
1 −1 2
𝐴 = [1 −2 3]
2 −2 1
−2 3
𝐴11 = (−1)1+1 | | = 1[(−2)(1) − (−2)(3)] =4
−2 1
1 3
𝐴12 = (−1)1+2 | | = −11[(1)(1) − (2)(3)] =5
2 1
1 −2
𝐴13 = (−1)1+3 | | = 1[(1)(−2) − (2)(−2)] =2
2 −2
−1 2
𝐴21 = (−1)2+1 | | = −11[(−1)(1) − (−2)(2)] = −3
−2 1
1 2
𝐴22 = (−1)2+2 | | = 1[(1)(1) − (2)(2)] = −3
2 1
1 −1
𝐴23 = (−1)2+3 | | = −1[(1)(−2) − (2)(−1)] = 0
2 −2
−1 2
𝐴31 = (−1)3+1 | | = 1[(−1)(3) − (−2)(2)] =1
−2 3
1 2
𝐴32 = (−1)3+2 | | = −1[(1)(3) − (1)(2)] = −1
1 3
1 −1
𝐴33 = (−1)3+3 | | = 1[(1)(−2) − (1)(−1)] = −1
1 −2
𝟒 −𝟑 𝟏
∴ 𝒂𝒅𝒋 𝑨 = [𝟓 −𝟑 −𝟏]
𝟐 𝟎 −𝟏
▪ Inverse of a Matrix
Let:
a11 a12 … a1n 𝑥1 𝑏1
a a22 … a2n 𝑥2 𝑏2
A = [ 21 ] 𝑥=[ ] B=[ ]
⋮ ⋮ ⋱ ⋮ ⋮ ⋮
am1 am2 … amn 𝑥3 𝑏𝑚
Where:
A – coefficient matrix
x – column matrix of unknown variables
B – constant values
And,
B
A𝑥 = B 𝑥=A
𝒙 = 𝐀−𝟏 ∙ 𝐁
For example:
Find the values of the unknown variables in the linear systems as
shown (same example from Determinant).
𝑥 − 𝑦 + 2𝑧 = 0
𝑥 − 2𝑦 + 3𝑧 = −1
2𝑥 − 2𝑦 + 𝑧 = −3
Solution:
1 −1 2 𝑥 0
𝐴 = [1 −2 3] 𝑥 = [𝑦] 𝐵 = [−1]
2 −2 1 𝑧 −3
𝒙 = 𝐀−𝟏 ∙ 𝐁
−2 3
𝐴11 = (−1)1+1 | | = 1[(−2)(1) − (−2)(3)] =4
−2 1
1 3
𝐴12 = (−1)1+2 | | = −11[(1)(1) − (2)(3)] =5
2 1
1 −2
𝐴13 = (−1)1+3 | | = 1[(1)(−2) − (2)(−2)] =2
2 −2
−1 2
𝐴21 = (−1)2+1 | | = −11[(−1)(1) − (−2)(2)] = −3
−2 1
1 2
𝐴22 = (−1)2+2 | | = 1[(1)(1) − (2)(2)] = −3
2 1
1 −1
𝐴23 = (−1)2+3 | | = −1[(1)(−2) − (2)(−1)] = 0
2 −2
−1 2
𝐴31 = (−1)3+1 | | = 1[(−1)(3) − (−2)(2)] =1
−2 3
1 2
𝐴32 = (−1)3+2 | | = −1[(1)(3) − (1)(2)] = −1
1 3
1 −1
𝐴33 = (−1)3+3 | | = 1[(1)(−2) − (1)(−1)] = −1
1 −2
𝟒 −𝟑 𝟏
∴ 𝒂𝒅𝒋 𝑨 = [𝟓 −𝟑 −𝟏] and |𝑨 | = 𝟑
𝟐 𝟎 −𝟏
1
A−1 = ∙ 𝑎𝑑𝑗 𝐴
|𝐴 |
4 −3 1 4 1
−1
3 3 3 3 3
5 −3 −1 5 −1
A−1 = → A−1 = −1
3 3 3 3 3
2 0 −1 2 −1
[3 3 3] [3 0 3]
𝒙 = 𝐀−𝟏 ∙ 𝐁
4 1
−1
𝑥 3 3
5 −1 0
[𝑦 ] = −1 [−1]
𝑧 3 3 −3
2 −1
[3 0
3]
4 1
( ) (0) + (−1)(−1) + ( ) (−3)
3 3
𝑥
5 1
[𝑦] = ( ) (0) + (−1)(−1) + (− ) (−3)
𝑧 3 3
2 1
( ) ( )( ) ( )
[ (3) 0 + 0 −1 + (− 3) −3 ]
𝑥 1−1 𝒙 𝟎
[𝑦] = [1 + 1] → ∴ [𝒚] = [𝟐]
𝑧 1 𝒛 𝟏
By using Mathcad, we can see the ease of solving for the values of
the unknown variables of a solution of linear systems. By knowing the
correct format to be used in Mathcad, the lengthy solution of linear systems
can be omitted (See figure 4-17).