Alternative Mathematics Using MATLAB 7

1 Introduction 1
Installing the Student Version of MATLAB®  7
Page References 3
How to Use this Book 3

2 MATLAB as a Calculator
6
Some Useful Functions 8

3 Geometric Applications 13
The Cosine Theorem 13
The Sine Theorem 15
Area of a Triangle 16

4 Vectors in (x, y) and (x, y, z) 18
Vectors in (x, y ,z) 22

5 General Vectors 25
More Element-by-Element Operations 26
Special Operations on Vectors 27
Row and Column Vectors 29
Summary of Element-by-Element Operations 29

6 Systems of Linear Equations 31
Two Unknown Variables 31
Three Unknown Variables 32
Many Unknown Variables 33
Matrix Algebra (Optional) 34

7 Plotting Functions 38
The Help Command 40
Plotting Two Functions Simultaneously 41

8 Script Files 43
Managing Script Files 43
A Familiar List of Commands 44
Layout Preferences 45
Another Familiar Example 46
A System of Linear Equations 47
Startup File 48

9 Functions and Function Files 50
Inverse Trigonometric Functions 51
Exponential Functions 53
Logarithmic Functions 54
Logarithmic Plots 55
Inline Functions 56
Function Files 57
Curves in Polar Coordinates 58

10 Zeros and Extreme Points 62
Simplified Plotting 62
Solving by Bisection 63
Solving a Cubic Polynomial Equation 64
A More Flexible Script File 65
The Built-In Algorithm 66
Transcendental Equations 66
Verifying Solutions 67
Minimum and Maximum Points 68

11 Symbolic Algebra 70
Solving Algebraic Equations 70
Recasting Expressions 71
Solving Systems of Linear Equations 73
Solution by Matrices 74
New Function Plotter 75
Numerical Approximation 76

12 Limits 77
Limits Toward Large Values 77
Limits Toward Zero 80

13 Derivatives 82
First-Order Derivative 82
Second-Order Derivative 86

14 Sums 89
Convergent Series 90
Divergent Series 91
Trigonometric Series 92

15 Integrals 94
Stairs Integration 94
Trapezoidal Integration 95
Quadratic Approximation 96
Improper Integrals 98

16 Symbolic Calculus 101
Limits 101
Derivatives 102
Taylor Expansions 102
Sums 104
Indefinite Integrals 105
Definite Integrals 106
An Easy Way to the Simpson Formula 107

17 Random Events and Statistics 110
Seeds 110
Randomness 111
Test by a Histogram 112
Flipping for Heads or Tails 113
Repeated Sequences of Tosses 114
Comparison with Probability Theory 115
Mean Value and Standard Deviation 118
Binomial and Normal Distributions 119

18 Curve Fitting (Optional) 122
Mean Value as a Minimum 122
Elements of Curve Fitting 124
Determining the Fitting Parameter 126
Curve Fitting to External Data 126
Simulating Measurements 128
Motion of a Ball 128
More General Curve Fitting 130
Residual after the Fit 133
Fitting to Real Experimental Data 134

19 First-Order Differential Equations 136
Direction Fields 136
Simple Numerical Solutions 138
Non-Linear ODEs 142
Smarter than Euler 145
Curious Behavior of a Non-Linear ODE 146

20 Second-Order ODEs 150
Ball Suspended by a Spring 151
Analytic Solution to the Spring Problem 153
Solving a System of ODEs by the RKF Method 154
Swinging Pendulum 154
Approximate Analytic Solution 156
Non-Periodic Solutions 157

21 Symbolic Solutions to ODEs 161
First-Order, Linear ODEs 161
Systems of First-Order, Linear ODEs 164
Second-Order ODEs 165
Boundary Conditions 166

22 Functions of Two Variables 169
Surfaces 169
Zero Curves (Optional) 173
Minimum and Maximum Points 174

23 Complex Numbers and Functions 177
Functions of a Complex Variable 177
Complex Linear Equations 178
Alternating Current 178
Complex Zeros of a Polynomial 181
Locating Complex Zeros 183
Symbolic Treatment of Complex Expressions 184
Symbolic Algebraic Equations 184

24 Fourier Series 188
Continuous Functions 188
Discontinuous Functions 193
Arbitrary Period Length 196

25 Fourier Transforms 199
Discrete Fourier Transforms 201
Simple Fourier Transform 202
Transform of a Gaussian 202
Transform of a Rectangular Pulse 204
Transform of an Odd Function 205
Transform of a Sine Function 207
Transform of a Rectangular Wave Train 210
The Fourier Sum is Periodic! 211
Analysis of a Noisy Signal 212
Inverse Transforms 214
High-Speed Fourier Transforms 218
Fourier Transforms by Symbolic Means 218

Appendix: Fast Fourier Transforms 221
Modified Fast Fourier Transform 223

Appendix: Eigenvalues and Eigenvectors 226
Curious Systems of Linear Equations 226
Special Matrix Conditions 228
Balls Connected by a Spring 230
Symbolic Treatment of Eigenvalues 231
Large Spring-Coupled Systems 233
Quadratic Forms 233

Conclusion 237

Vocabulary of MATLAB 238