No Bullshit Guide to Mathematics

Ivan Savov

October 25, 2020

Contents

Concept maps

Preface

Introduction

Chapter 1 Numbers, variables, and equations

1.1 Solving equations

1.2 Numbers

1.3 Number representations

1.4 Variables

1.5 Functions and their inverses

Chapter 2 Algebra

2.1 Basic rules of algebra

Chapter 3 Exponents and logarithms

Chapter 4 Coordinate systems

Chapter 5 Functions

Chapter 6 Geometry

Chapter 7 Vectors

Chapter 8 Extra topics

Chapter 9 Practice problems

End matter

Answers and solutions

Notation

SymPy tutorial

Concept maps

The diagrams below show all the topics and concepts covered in this book. Topics are shown in rectangular boxes. Concepts are shown in bubbles with rounded corners. Note the numerous connections.

Figure 1: The first chapter of the book covers essential concepts like numbers, number representations, equations, and functions.

Figure 2: In Chapter 2 we’ll learn about the rules of algebra, which codify what we’re allowed to do with math expressions.

You can annotate the concept maps with your current knowledge of each concept to keep track of your progress. Add a single dot (\bullet) next to all concepts you’ve heard of, two dots (\bullet\bullet) next to concepts you think you know, and three dots (\bullet\!\bullet\!\bullet) next to concepts you’ve used in exercises and problems. By collecting some dots every week, you’ll be able to move through the material in no time at all.

If you don’t want to mark up your book, you can download a printable version of the concept maps here: bit.ly/mathcmap.

Figure 3: Visual thinking plays a very important role in mathematics. In Chapter 4 we’ll learn about the Cartesian plane, which is a two-dimensional coordinate system used to represent points, vectors, and function graphs. Then in Chapter 6 we’ll learn about the fundamental geometric shapes like triangles, pyramids, cones, circles, ellipses, parabolas, and hyperbolas. We’ll also dedicate several sections to familiarizing ourselves with trigonometry, trigonometric functions, and trigonometric identities.

Figure 4: In Chapter 7, we’ll use our algebra and geometry skills to learn about vectors and vector operations. In Chapter 8, we’ll discuss math applications and formal math methods like proofs.

Preface

Why this book?

Math is a beautiful subject with many practical applications. Yet many people feel uncomfortable around math. Some even claim to “hate” math and try to avoid the subject. Countless adults are living with math phobia. That’s too bad because learning math opens many doors to understanding concepts in science, computing, music, and business. Math is also useful for accomplishing day-to-day tasks.

Why learn math?

Math is a universal language for describing patterns and shapes. Math is everywhere around us. When you learn math, you’ll be able to see the equations behind real-world phenomena, and then use these equations to predict the future. How cool is that? Learning math will also help you make better daily decisions like avoiding predatory loans, estimating times and distances when travelling, double-checking calculations in contracts and bills, and forecasting the cash flow of your business. Math is not just for scientists and engineers—everyone benefits from knowing math the same way everyone benefits from knowing how to read and write.

Is this book for you?

This book is written for adult learners who think they suck at math and feel uncomfortable around numbers and equations. Whether you hate math because of bad experiences, feel disheartened at the sight of equations, or simply don’t see the point of learning math, this book has something to offer you. It’s time to reconnect with this beautiful subject.

This book will be useful for everyone who wants to learn math. High school students can quickly learn the material they need for their classes. University students can use the book to review and prepare for more advanced subjects like calculus, statistics, and linear algebra. Parents who want to help their kids with homework can depend on this book to refresh their math skills.

How are we going to do this?

This book approaches math by showing you the connections between concepts. Learning math does not require memorizing facts and equations. It’s not about how many equations you know, but about knowing how to get from one equation to another. Consult the concept maps on pages 1 and 3 to see all the topics covered in the book and how they are interconnected.

Each section in this book is a short tutorial that covers one math topic with precise definitions, illustrative examples, and concise explanations. By progressing through the chapters and sections of this book, you’ll develop your math knowledge step by step, with each new layer of understanding building upon the previous ones. The book covers numbers, sets, variables, equations, algebra, functions, geometry, trigonometry, and also math applications to personal finance. If it’s useful math, we’ve got it covered! To ensure that you really grasp the material, the book provides numerous exercises and practice problems (see Chapter 9). You’ll find the answers to all the exercises and problems in Appendix 1 (page 1).

About the publisher

Minireference Co. is a publisher specializing in math and science. Our goal is to make advanced math modelling tools accessible to everyone by producing affordable textbooks that explain math concepts clearly and concisely. It’s time for a break from traditional textbooks that are expensive, heavy, and tedious to read. The books in the No Bullshit Guide series are an efficient and enjoyable alternative for learning mathematical subjects. Whether you’re a student, a parent, or an adult learner, we’ve got a book for you that will help you level-up in math.

About the author

I have been tutoring math and physics for more than 17 years. Through this experience, I learned to break complicated ideas into smaller, interconnected chunks that are easy to understand. I think the best way to teach math is to clearly define concepts and show the paths that connect them. When learners know the basic vocabulary and are able to find their way in a new mathematical domain, the battle against math phobia is already half won.

Ivan Savov Montreal, 2020

Introduction

If you look carefully, you’ll find mathematical patterns all around you: complex patterns like the water waves on the surface of a lake, medium-complexity patterns like the up-and-down oscillations of a mass suspended on a spring, and basic patterns that occur in all numbers and geometric shapes.

This is a book about basic math patterns. The goal is to introduce you to fundamental building blocks like numbers, expressions, functions, algebra, and geometry. Understanding basic math concepts will provide you with a common core of tools that you can use in diverse fields like physics, chemistry, biology, medicine, engineering, and business.

Thinking like a mathematician means being able to notice the patterns everywhere around you. That’s what mathematicians do all day—seriously! First you observe a pattern; then you try to describe the pattern (this is usually where the equations and formulas come in); finally you use the pattern to achieve some practical outcome. Would you believe me if I told you that a few equations scribbled on a paper napkin can predict the outcome of a quantum physics experiment, calculate the yield of a chemical reaction, predict the growth rate of bacteria, save a patient’s life, build a bridge, and maximize the profits of a startup?

Do I have your attention? I hope at this point you’re interested in learning at least a little bit of math. Or perhaps you still feel kind of weird about reading a math book, and extra weird about reading a math book by choice, without someone forcing you to read it. What kind of trouble are you getting yourself into?

Relax. Math is no trouble. Learning math is not something to worry about or foresee as difficult. Math is not some sort of obstacle you have to jump over in one shot. Learning math is more like climbing a mountain. It’s up to you to choose the pace of your climb. By investing some time in reading and solving exercises, everyone can gradually make it up the mountain.

The trick to learning math is to redefine what math means to you. Dear reader, trust me on this one: math does not involve memorization and rote calculations! That’s arithmetic. It’s great if you’re fast at adding, subtracting, multiplying, and dividing, but real math is so much more than that. For example, learning some basic algebra rules will allow you to simplify complicated expressions by rewriting them as equivalent but shorter expressions, so by the time you start plugging in the numbers you have a lot less arithmetic to do. The more algebra you learn, the less arithmetic you’ll need to do. What? We learn more math in order to do less math? Yes, that’s pretty much the whole point of the subject. Knowing how to recognize abstract patterns, how to describe them precisely, and how to use them to simplify problems turns out to be a very useful skill set.

In addition to being a useful tool for learning other sciences, learning math is interesting on its own. There will be some beautiful views at the end of each climb up the math mountains.

Guide to the math mountains

This book is your guide for the first part of your journey in the math mountains. Math concepts like numbers, equations, functions, algebra, and geometry are the first peaks you must climb on your way to the major math and science mountains.

In Chapter 1, we’ll start by defining fundamental math ideas including numbers, variables, equations, and functions. These are the main building blocks of math, and we’ll use them throughout the book. Readers who are new to mathematics should read Chapter 1 carefully and invest the time needed to solve the exercises.

Algebra! Yes, there, I said it. In Chapter 2 we’ll learn the rules of algebra, which consist of various simplifications, reductions, and expansions we can perform on math expressions. Learning algebra by memorizing a bunch of rules is a very difficult task. Instead, you can think of algebra as a language. Algebra techniques are verbs that we apply to math expressions. To expand the expression a(b+c) means to write the expression as ab+ac. To factor the expression ax+ay+az is to write it as a(x+y+z). To learn algebra you’ll need to learn some new nouns: variable, term, factor, expression, equation. You’ll also need to become familiar with the algebra verbs: to solve (equations), to factor, to simplify, to expand (expressions), to complete the square (in a quadratic expression), etc.

Are you still with me, dear reader? I know the prospects of learning algebra might not seem like the most exciting thing ever, and I’m not going to lie to you and say it will be easy to develop your expression-simplifying skills, but the payoff is totally worth it.

In Chapter 3 we’ll discuss exponents and logarithms in detail. For instance, the expression a^x means to multiply a by itself x times. Exponents have some interesting properties, which we’ll spend some time exploring. We’ll also discuss the logarithmic function \log_a(x), which is the inverse function of the exponential function a^x.

In Chapter 4 we’ll discuss the Cartesian plane, which allows us to visualize math concepts like points, vectors, and geometric shapes. We can also use the Cartesian plane to plot function graphs, which are visual representations of how functions behave for all inputs. Chapter 5 is dedicated to the study of functions. We’ll introduce important new vocabulary for describing functions’ inputs, outputs, and other properties. We’ll build a catalogue of the 10 most important functions for math and scientific modelling. We’ll also discuss how to combine, modify, and transform basic functions in order to form composite functions with various desirable properties.

The subject of geometry deals with shapes, transformations, distances, areas, and volumes. In Chapter 6 we’ll learn about geometry, and discuss various formulas for lines, circles, cylinders, spheres, and other shapes. We’ll also discuss trigonometry—the study of the relative lengths of the sides of right-angle triangles.

In Chapter 7 we’ll discuss vectors, which are used to describe directions in space. Vectors are useful for science calculations, computing, statistics, machine learning, and myriad other domains.

In Chapter 8 we’ll discuss various supplementary math topics. We’ll see how to solve systems of linear equations, how to compute compound interest, and learn a bit about proofs and set notation. Learning set notation (Section sec:set_notation) is a key foundation for studying more advanced math topics.

The book concludes with a sizeable set of problems (Chapter 9). Take note, dear reader: math is not a spectator sport. Reading math is not enough—you must also practice your skills by solving problems.

Use the maps

The concept maps on pages 1 and 3 show an overview of the concepts and topics we’ll discuss in the book. Note the numerous connections between concepts. Understanding these connections is the key to understanding math: math isn’t a random bunch of facts, but an interconnected network of ideas.

Are you ready for this? Let’s get started!

Chapter 1 Numbers, variables, and equations

In this chapter we’ll introduce the fundamental building blocks of math: numbers, variables, equations, and functions. Learning about the basics will establish a solid foundation for all other topics that are to come.

We’ll start by learning a general procedure for solving equations. This is a fundamental skill you’ll develop throughout the book, starting in Section 1.1 and expanding as you learn about more advanced types of equations and solution techniques. In Section 1.2 we’ll define the different types of numbers that exist, then discuss number representations in Section 1.3. In Section 1.4 we’ll learn how to use variables like k and x to represent unknowns in equations.

We’ll then discuss functions and function inverses in Section 1.5. A function describes a transformation between an input variable x and a corresponding output variable y. The inverse function describes the same transformation in the opposite direction, treating y as the input and x as the output. By learning how to apply functions and function inverses to solve equations, you’re taking one giant step toward acquiring math superpowers. Overall, your knowledge of numbers, variables, equations, and functions will allow you to solve many types of problems on the journey ahead.

1.1 Solving equations

Most math skills boil down to being able to manipulate and solve equations. Solving an equation means finding the value of the unknown in the equation.

Check this out:

To solve the above equation is to answer the question “What is x?” More precisely, we want to find the number that can take the place of x in the equation so that the equality holds. In other words, we’re asking,

That is quite a mouthful, don’t you think? To remedy this verbosity, mathematicians often use specialized symbols to describe math operations. The problem is that these specialized symbols can be very confusing. Sometimes even the simplest math concepts are inaccessible if you don’t know what the symbols mean.

What are your feelings about math, dear reader? Are you afraid of it? Do you have anxiety attacks because you think it will be too difficult for you? Chill! Relax, my brothers and sisters. There’s nothing to it. Nobody can magically guess the solution to an equation immediately. To find the solution, you must break the problem into simpler steps. Let’s walk through this one together.

To find x, we can manipulate the original equation, transforming it into a different equation (as true as the first) that looks like this:

That’s what it means to solve an equation: the equation is solved because the unknown is isolated on one side, while the constants are grouped on the other side. You can type the numbers on the right-hand side into a calculator and obtain the numerical value of x.

By the way, before we continue our discussion, let it be noted: the equality symbol (=) means that all that is to the left of = is equal to all that is to the right of =. To keep this equality statement true, for every change you apply to the left side of the equation, you must apply the same change to the right side of the equation.

To find x, we need to manipulate the original equation into its final form, simplifying it step by step until it can’t be simplified any further. The only requirement is that the manipulations we make transform one true equation into another true equation. In this example, the first simplifying step is to add the number four to both sides of the equation:

which simplifies to

Now the expression looks simpler, yes? How did I know to perform this operation? I wanted to “undo” the effects of the operation -4. We undo an operation by applying its inverse. In the case where the operation is the subtraction of some amount, the inverse operation is the addition of the same amount. We’ll learn more about function inverses in Section 1.5.

We’re getting closer to our goal of isolating x on one side of the equation, leaving only numbers on the other side. The next step is to undo the square x^2 operation. The inverse operation of squaring a number x^2 is to take its square root \sqrt{\phantom{a}\; }, so that’s what we’ll do next. We obtain

Notice how we applied the square root to both sides of the equation? If we don’t apply the same operation to both sides, we’ll break the equality!

The equation \sqrt{x^2}= \sqrt{49} simplifies to

What’s up with the vertical bars around x? The notation |x| stands for the absolute value of x, which is the same as x except we ignore the sign that indicates whether x is positive or negative. For example |5|=5 and |-5|=5, too. The equation |x|=7 indicates that both x=7 and x=-7 satisfy the equation x^2 = 49. Seven squared is 49, 7^2=49, and negative seven squared is also 49, (-7)^2 = 49, because the two negative signs cancel each other out.

The final solutions to the equation x^2-4=45 are

Yes, there are two possible answers. You can check that both of the above values of x satisfy the initial equation x^2-4=45.

If you are comfortable with all the notions of high school math and you feel you could have solved the equation x^2-4=45 on your own, then you can skim through this chapter quickly. If on the other hand you are wondering how the squiggle killed the power two, then this chapter is for you! In the following sections we will review all the essential concepts from high school math that you will need to power through the rest of this book. First, let me tell you about the different kinds of numbers.

1.2 Numbers

In the beginning, we must define the main players in the world of math: numbers.

Definitions

Numbers are the basic objects we use to count, measure, quantify, and calculate things. Mathematicians like to classify the different kinds of number-like objects into categories called sets:

The natural numbers: \mathbb{N} = \{0,1,2,3,4,5,6,7, \ldots \, \}

The integers: \mathbb{Z} = \{\ldots, -3,-2,-1,0,1,2,3 , \ldots \, \}

The rational numbers: \mathbb{Q} = \{\frac{5}{3}, \frac{22}{7}, 1.5, 0.125, -7, \, \ldots \, \}

The real numbers: \mathbb{R} = \{-1,0,1, \sqrt{2}, e,\pi, \; 4.94\ldots, \; \ldots \, \}

The complex numbers: \mathbb{C} = \{ -1, 0, 1, i, 1+i, 2+3i, \ldots \, \}

These categories of numbers should be somewhat familiar to you. Think of them as neat classification labels for everything that you would normally call a number. Each group in the above list is a set. A set is a collection of items of the same kind. Each collection has a name and a precise definition for which items belong in that collection. Note also that each of the sets in the list contains all the sets above it, as illustrated in Figure 1.1. For now, we don’t need to go into the details of sets and set notation, but we do need to be aware of the different sets of numbers.

Figure 1.1: An illustration of the nested containment structure of the different number sets. The set of natural numbers is contained in the set of integers, which in turn is contained in the set of rational numbers. The set of rational numbers is contained in the set of real numbers, which is contained in the set of complex numbers.

Why do we need so many different sets of numbers? Each set of numbers is associated with more and more advanced mathematical problems.

The simplest numbers are the natural numbers \mathbb{N}, which are sufficient for all your math needs if all you’re going to do is count things. How many goats? Five goats here and six goats there so the total is 11 goats. The sum of any two natural numbers is also a natural number.

As soon as you start using subtraction (the inverse operation of addition), you start running into negative numbers, which are numbers outside the set of natural numbers. If the only mathematical operations you will ever use are addition and subtraction, then the set of integers \mathbb{Z} = \{ \ldots, -2, -1, 0, 1, 2, \ldots \} will be sufficient. Think about it. Any integer plus or minus any other integer is still an integer.

You can do a lot of interesting math with integers. There is an entire field in math called number theory that deals with integers. However, to restrict yourself solely to integers is somewhat limiting—a rotisserie menu that offers \frac{1}{2} of a chicken would be totally confusing.

If you want to use division in your mathematical calculations, you’ll need the rationals \mathbb{Q}. The set of rational numbers corresponds to all numbers that can be expressed as fractions of the form \frac{m}{n} where m and n are integers, and n \neq 0. You can add, subtract, multiply, and divide rational numbers, and the result will always be a rational number. However, even the rationals are not enough for all of math!

In geometry, we can obtain irrational quantities like \sqrt{2} (the diagonal of a square with side 1) and \pi (the ratio between a circle’s circumference and its diameter). There are no integers x and y such that \sqrt{2}=\frac{x}{y}, therefore we say that \sqrt{2} is irrational (not in the set \mathbb{Q}). An irrational number has an infinitely long decimal expansion that doesn’t repeat. For example, \pi = 3.141592653589793\ldots where the dots indicate that the decimal expansion of \pi continues all the way to infinity.

Combining the irrational numbers with the rationals gives us all the useful numbers, which we call the set of real numbers \mathbb{R}. The set \mathbb{R} contains the integers, the rational numbers \mathbb{Q}, as well as irrational numbers like \sqrt{2}=1.4142135\ldots. By using the reals you can compute pretty much anything you want. From here on in the text, when I say number, I mean an element of the set of real numbers \mathbb{R}.

The only thing you can’t do with the reals is to take the square root of a negative number—you need the complex numbers \mathbb{C} for that. We defer the discussion on \mathbb{C} until the end of Chapter 7.

Operations on numbers

Addition

You can add numbers. I’ll assume you’re familiar with this stuff:

You can visualize numbers as sticks of different length. Adding numbers is like adding sticks together: the resulting stick has a length equal to the sum of the lengths of the constituent sticks, as illustrated in Figure 1.2.

Figure 1.2: The addition of numbers corresponds to adding lengths.

Addition is commutative, which means that a+b=b+a. In other words, the order of the numbers in a summation doesn’t matter. It is also associative, which means that if you have a long summation like a+b+c you can compute it in any order (a+b)+c or a+(b+c), and you’ll get the same answer.

Subtraction

Subtraction is the inverse operation of addition:

Unlike addition, subtraction is not a commutative operation. The expression a-b is not equal to the expression b-a, or written mathematically:

Instead we have b-a=-(a-b), which shows that changing the order of a and b in the expression changes its sign.

Subtraction is not associative either:

For example (7- 2) -3 = 2 while 7- (2-3) = 8.

Multiplication

You can also multiply numbers together:

Note that multiplication can be defined in terms of repeated addition.

The visual way to think about multiplication is as an area calculation. The area of a rectangle of width a and height b is equal to ab. A rectangle with a height equal to its width is a square, and this is why we call aa=a^2 “a squared.”

Figure 1.3: The area of a rectangle with width  m and height  m is equal to m^2, which is equivalent to six squares with area m^2 each.

Multiplication of numbers is also commutative, ab=ba, and associative, abc=(ab)c=a(bc). In modern math notation, no special symbol is required to denote multiplication; we simply put the two factors next to each other and say the multiplication is implicit. Some other ways to denote multiplication are a\cdot b, a\times b, and, on computer systems, a*b.

Division

Division is the inverse operation of multiplication.

Whatever a is, you need to divide it into b equal parts and take one such part.

Division is not a commutative operation since a/b is not equal to b/a. Division is not associative either: (a \div b) \div c \neq a \div (b \div c). For example, when a=6, b=3, and c=2, we get (6/3)/2=1 while 6/(3/2)=4.

Note that you cannot divide by . Try it on your calculator or computer. It will say “error divide by zero” because this action simply doesn’t make sense. After all, what would it mean to divide something into zero equal parts?

Exponentiation

The act of multiplying a number by itself many times is called exponentiation. We denote “a exponent n” using a superscript, where n is the number of times the base a is multiplied by itself:

In words, we say “a raised to the power of n.”

To visualize how exponents work, we can draw a connection between the value of exponents and the dimensions of geometric objects. Figure 1.4 illustrates how the same length corresponds to different geometric objects when raised to different exponents. The number corresponds to a line segment of length two, which is a geometric object in a one-dimensional space. If we add a line segment of length two in a second dimension, we obtain a square with area 2^2 in a two-dimensional space. Adding a third dimension, we obtain a cube with volume 2^3 in a three-dimensional space. Indeed, raising a base a to the exponent is commonly called “a squared,” and raising a to the power of is called “a cubed.”

The geometrical analogy about one-dimensional quantities as lengths, two-dimensional quantities as areas, and three-dimensional quantities as volumes is good to keep in mind.

Figure 1.4: Geometric interpretation for exponents , , and . A length raised to exponent corresponds to the area of a square. The same length raised to exponent corresponds to the volume of a cube.

Our visual intuition works very well up to three dimensions, but we can use other means of visualizing higher exponents, as demonstrated in Figure 1.5.

Figure 1.5: Visualization of numbers raised to different exponents. Each box in this grid contains a^n dots, where the base a varies from one through five, and the exponent n varies from one through five. In the first row we see that the number a=1 raised to any exponent is equal to itself. The second row corresponds to the base a=2 so the number of dots doubles each time we increase the exponent by one. Starting from 2^1=2 in the first column, we end up with 2^5=32 in the last column. The rest of the rows show how exponentiation works for different bases.

Operator precedence

There is a standard convention for the order in which mathematical operations must be performed. The basic algebra operations have the following precedence:

Parentheses

Exponents

Multiplication and Division

Addition and Subtraction

If you’re seeing this list for the first time, the acronym PEMDAS and the associated mnemonic “Please Excuse My Dear Aunt Sally,” might help you remember the order of operations.

For instance, the expression 5\cdot 3^2+13 is interpreted as “First find the square of , then multiply it by , and then add .” Parentheses are needed to carry out the operations in a different order: to multiply times first and then take the square, the equation should read (5\cdot 3)^2 + 13, where parentheses indicate that the square acts on (5 \cdot 3) as a whole and not on alone.

Exercises

E1.1 Solve for the unknown x in the following equations:

a) 3x+2-5=4+2 b) \frac{1}{2}x-3=\sqrt{3}+12-\sqrt{3}

c) \frac{7x-4}{2} +1 = 8-2 d) 5x-2+3=3x-5

E1.2 Indicate all the number sets the following numbers belong to.

a) -2 b) \sqrt{-3} c) 8 \div 4 d) \frac{5}{3} e) \frac{\pi}{2}

E1.3 Calculate the values of the following expressions:

a) 2^33-3 b) 2^3(3-3) c) \frac{4-2}{3^3}(6\cdot 7- 41)

1.3 Number representations

We use the letters “a, b, c, …” to write words. In a similar fashion, we use the digits 0,1,2,3,4,5,6,7,8, and to write numbers in the language of math. You can think of the digits through as the “letters” used to write numbers. For example, the number consists of the digits , , and . Note that the same digit denotes two different quantities depending on its position within the number. The first digit corresponds to the value three hundred, while the second digit corresponds to the value thirty.

Concepts

In this section, we’ll review three important number representations:

The decimal notation for integers, rationals, and real numbers consists of an integer part and a fractional part separated by a decimal point. For example, the decimal 32.17 consists of the integer and the fractional part 0.17.

The fraction notation for integers and rational numbers consists of a numerator divided by a denominator. Here are some sample math expressions with fractions: \frac{1}{2}, \frac{3}{4}, \frac{3}{2}=1\frac{1}{2}, and \frac{17}{100}.

The number line is a graphical representation for numbers that allows us to visualize numbers as geometric points on a line.

The same number a can be represented in multiple equivalent ways. It is often convenient to convert from one representation to another depending on the calculations we need to perform. For example, the number three can be expressed as the numeral , the decimal 3.0, the fraction \frac{3}{1}, or as the point that lies three units to the right of the origin on the number line. All these representations refer to the same quantity, but each representation is useful in different contexts. The goal of this section is to get you comfortable working with all the number representations.

Positional notation for numbers

The Hindu–Arabic numeral system is the most widely used system for writing numbers today. It is a decimal positional system. The term decimal refers to the fact that it uses 10 unique symbols (the digits through ) to represent numbers. The system is positional because the value of each digit depends on its position within the number. Positional number systems are also called place-value systems.

Figure 1.6: The place-value representation of the number a = a_3a_2a_1a_0.

Note the terminology used to refer to the individual digits of the numeral: we call a_3 the thousands, a_2 the hundreds, a_1 the tens, and a_0 the units.

Any natural number a \in \mathbb{N}, no matter how large, can be written as a sequence of digits:

where the digits a_0, a_1, …come from the set \{0,1,2,3,4,5,6,7,8,9\}.

For example, the numeral corresponds to this calculation:

Note how the English pronunciation of the number, “four thousand, two hundred and thirty-five,” literally walks you through the calculation.

Decimal representation

Any number a less than one can be written as a decimal point followed by a sequence of digits, as illustrated in Figure 1.7.

The decimal point indicates the beginning of the fractional part of a number. The place values of the digits to the right of the decimal point correspond to different decimal fractions. For example, the digit corresponds to three different decimal fractions depending on its position within the number:

Figure 1.7: The decimal representation of a number smaller than one.

The first digit to the right of the decimal point a_{-1} represents the tenths, the second digit a_{-2} represents the hundredths, the third the thousandths, and so on.

In general, a number written in decimal notation has both an integer part and a fractional part:

The decimal point appears in the middle of the digits and acts as a separator. The digits to the left of the decimal point, a_{n}\cdots a_{2}a_{1}a_{0}, correspond to the integer part of the number, while the digits to the right of the decimal, 0.a_{-1}a_{-2}a_{-3}\cdots, correspond to the fractional part of the number.

Figure 1.8: The decimal number a consists of an integer part a_3a_2a_1a_0 and a fractional part 0.a_{-1}a_{-2}\cdots separated by the decimal point.

Note the names for the different digits in the fractional part of the decimal in Figure 1.8. These names are used when we describe the fractional part of a decimal in words:

“1.4” is read “one and four tenths,” or you could informally describe the decimal as you see it written: “one point four.”

“45.37” is read “forty-five and thirty-seven hundredths,” or sometimes “forty-five point three seven.”

A length measurement like “0.345 in” is read “three-hundred forty-five thousandths of an inch.”

We can use decimal notation to represent rational numbers like one-half (0.5), one-quarter (0.25), and three-quarters (0.75). We can also use decimal notation to write approximations to irrational numbers. For example, the irrational number \sqrt{2} (the diagonal of a square with length one) is approximately equal to 1.41421. We say the approximation 1.41421 is “accurate to five decimals,” because this is how many digits there are in its fractional part.

So far we reviewed the decimal representation for numbers, which is very familiar to us from everyday life. Perhaps you’re starting to think that math isn’t so bad after all? Some of you must be saying, “Wonderful, I’m becoming friends with numbers while avoiding uncomfortable topics like fractions.” Sorry, but you’re not getting off so easily because this is exactly what’s coming up next. That’s right, we’re about to make friends with fractions, too.

Fractions

Fractions describe what happens when a whole is cut into n equal parts and we are given m of those parts. For example, the fraction \frac{3}{8} describes having three parts out of a whole cut into eight parts, hence the name “three-eighths.”

Figure 1.9: The fraction \frac{3}{8} can be visualized as three slices from a pizza that has been cut into eight equal slices.

It’s important to understand fractions because many math concepts like rational numbers (\mathbb{Q}), ratios, percents, and probabilities are best described in the language of fractions.

Definitions

The fraction “a over b” can be written three different ways:

The top and bottom parts of the fraction \dfrac{a}{b} have special names:

b is called the denominator of the fraction. It tells us how many parts make up the whole.

a is called the numerator. It tells us the number of parts we have.

Fractions are the most natural way to represent rational numbers. Why natural? Check out these simple fractions:

The fractional notation on the left is preferable because it shows the underlying structure of the number while avoiding the need to write complicated decimals.

When written as decimal numbers, certain fractions have infinitely long decimal expansions. We use the overline notation to indicate the digit(s) that repeat infinitely in the decimal, as in the case of 0.\overline{3}, 0.1\overline{6}, and 0.\overline{142857} shown above.

Fractions allow us to carry out precise mathematical calculations easily with pen and paper, without the need for a calculator.

Example

Calculate the sum of \frac{1}{7} and \frac{1}{3}.

Let’s say we decide, for reasons unknown, that it’s a great day for decimal notation—we’d have to write our calculation as

Wow that was complicated! This calculation is much simpler if we use fractions:

Want to know how we did that? We multiplied the first term by \frac{3}{3}=1 and the second term by \frac{7}{7}=1 in order to obtain two equivalent fractions with the same denominator. This is one of the standard strategies when performing fraction operations: rewriting them as equivalent fractions that have the same denominator.

Equivalent fractions

The fractions \frac{3}{8}, \frac{6}{16}, and \frac{12}{32} all correspond to the same number. Think about it—if you cut a pizza in 8 pieces and take 3 of them (see Figure 1.9), or you cut a pizza in 16 equal pieces and take 6 of them, you’ll get the same amount of pizza in the end. All fractions of the form \frac{3k}{8k} are equivalent to the fraction \frac{3}{8}, meaning they correspond to the same number.

Multiplying fractions

Fraction multiplication involves multiplying the numerators together and multiplying the denominators together:

For example, the product of the fractions \frac{1}{3} and \frac{1}{2} gives \frac{1}{3} \times \frac{1}{2} = \frac{1 \times 1}{3 \times 2} = \frac{1}{6}. This calculation shows that taking “one third of one half of some thing” is the same as taking one sixth of that thing.

Dividing fractions

To divide two fractions, compute the product of the first fraction times the second fraction “flipped” upside down:

In other words, division by the fraction \frac{c}{d} is the same as multiplication by the fraction \frac{d}{c}. This is called the “flip and multiply” rule for dividing fractions. For example, to divide the fraction \frac{1}{3} by the fraction \frac{1}{2}, we do the following calculation: \frac{1}{3} / \frac{1}{2} = \frac{1}{3} \times \frac{2}{1} = \frac{2}{3}.

Reciprocals

The mathematical term reciprocal is used to describe the notion of “flipping” a number. The reciprocal of y is \frac{1}{y}, which is read “one over y.” Multiplication by the reciprocal \frac{1}{y} is the same as division by y. The product of any number and its reciprocal equals one: y \times \frac{1}{y} = \frac{y}{y} = 1. The reciprocal of the fraction \frac{m}{n} is the “flipped” fraction \frac{n}{m}. The product of \frac{m}{n} and its reciprocal equals one: \frac{m}{n} \times \frac{n}{m} = \frac{mn}{nm} = 1.

Another way to denote the notion of “flipping” a number is to use the exponent negative one. The reciprocal of the number y is denoted y^{-1} and equals \frac{1}{y}. The reciprocal of the fraction \frac{m}{n} is denoted (\frac{m}{n})^{-1} and equals \frac{n}{m}. Using the negative exponent notation for reciprocals, we can write the “flip and multiply” rule for dividing fractions as \frac{a}{b} \div \frac{c}{d} = \frac{a}{b} \times \big(\frac{c}{d}\big)^{-1} = \frac{a}{b} \times \frac{d}{c} = \frac{ad}{bc}. We’ll discuss negative exponents more generally in Section sec:exponents.

Adding fractions

Suppose we are asked to find the sum of the two fractions \frac{a}{b} and \frac{c}{d}. If the denominators are the same, then we can add just the top parts: \frac{1}{5} + \frac{2}{5} = \frac{3}{5}. It makes sense to add the numerators since they refer to parts of the same whole.

However, if the denominators are different, we cannot add the numerators directly since they refer to parts of different wholes. Before we can add the numerators, we must rewrite the fractions so they have the same denominator, called a common denominator. We can obtain a common denominator by multiplying the first fraction by \frac{d}{d}=1 and the second fraction by \frac{b}{b}=1 in order to make the denominator of both fractions the same:

Now that we have fractions with the same denominator, we can add their numerators. Note it’s okay to change the denominator of a fraction as long as we also change the numerator in the same way. Multiplying the top and the bottom of a fraction by the same number is the same as multiplying by . So while the numbers of the fractions change, their equivalency is preserved:

Example

To add \frac{1}{6} and \frac{1}{15}, we can use the product of the two denominators as the common denominator, 6 \times 15 = 90, and perform the fraction addition as follows:

Note how we simplified the fraction by removing the factor that is common to both the numerator and the denominator. The final answer \frac{7}{30} is a reduced fraction equal to \frac{21}{90}.

The rules for subtracting fractions are the same as for adding fractions: computing the subtraction \frac{a}{b} - \frac{c}{d} is the same as computing the addition \frac{a}{b} + \frac{-c}{d}.

Whole-and-fraction notation

A fraction greater than like \frac{5}{3} can also be denoted 1\frac{2}{3}, which is read as “one and two-thirds.” Similarly, \frac{22}{7}=3\frac{1}{7}. We write the integer part of the number first, followed by the fractional part.

There is nothing wrong with writing fractions like \frac{5}{3} and \frac{22}{7}. However, some teachers call these fractions improper and demand that all fractions are written in the whole-and-fraction way, as in 1\frac{2}{3} and 3\frac{1}{7}. At the end of the day, both notations are correct.

Number line

The number line is a very useful visual representation for numbers. Every number from the sets \mathbb{N}, \mathbb{Z}, \mathbb{Q}, and \mathbb{R} corresponds to some point on the number line. Developing a visual representation for numbers allows us to instantly compare the numbers’ sizes based on their positions on the number line.

Figure 1.10 shows the natural numbers \mathbb{N} = \{\, 0,1,2,3,4,5, \, \ldots \, \} represented as equally spaced points on the number line. We can construct the entire set of natural numbers by starting from and taking steps of length one to the right on the number line. That’s what counting is—we just keep adding one.

Note that natural numbers never end. We can always keep adding one to every number and obtain a larger number. The number line therefore extends to the right to infinity.

Figure 1.10: The natural numbers \mathbb{N}.

The integers \mathbb{Z} = \{\ldots, -5, -4, -3,-2,-1,0,1,2,3,4,5, \ldots \, \} are similar to the naturals, but they also extend to the left of zero. Numbers to the left of zero are negative, while numbers to the right of zero are positive. The number line extends indefinitely on both sides, going to negative infinity on the left and positive infinity on the right.

Figure 1.11: The integers \mathbb{Z}.

The set of integers corresponds to a set of equally-spaced points on the number line with gaps of empty space between each integer. We need the real numbers \mathbb{R} to fill these gaps.

The set of real numbers \mathbb{R} is the complete representation of all possible points on the number line: every real number corresponds to some point on the number line, and every point on the number line corresponds to some real number. Visually, the set of real numbers fills the entire number line in bold, as shown in Figure 1.12. In other words, there are real numbers everywhere!

Figure 1.12: The real numbers \mathbb{R} cover the entire number line.

Recall that the set of real numbers includes all the rational numbers like -\frac{3}{2}, \frac{1}{2}, and \frac{9}{2}, as well as irrational numbers like \sqrt{2}, e, and \pi. This means any number you are likely to run into when solving math problems can be visualized as a point on the number line. The number line can also be used to represent subsets of the real numbers. We’ll talk about that in Section sec:set_notation. For example, the subset of real numbers that are greater than two and smaller than four is shown in Figure fig:interval_2open_to_4open (page fig:interval_2open_to_4open).

Discussion

Since we’re still on the topic of number representations, I want to add some footnotes with “bonus material” related to the ideas we’ve covered in this section. Feel free to skip to the next section if you’re in a hurry, because this is definitely not going to be on the exam!

Elementary arithmetic procedures

The four basic arithmetic operations are addition, subtraction, multiplication, and division. We can perform these operations for numerals a and b of any size using only pen and paper. It is sufficient to follow one of the well-defined procedures (called algorithms) for manipulating the individual digits that make up the numbers. The Wikipedia articles on elementary arithmetic and long division offer an excellent discussion of these procedures.

[ Algorithms for performing elementary arithmetic ] https://en.wikipedia.org/wiki/Elementary_arithmetic https://en.wikipedia.org/wiki/Long_division

Computer representations

Whenever you want to store a number on a computer, you must choose an appropriate computer representation for this number. The two most commonly used types of numbers in the computer world are integers (int) and floating point numbers (float). Computer integers can accurately describe the set of mathematical integers \mathbb{Z}, but there are limitations on the maximum size of numbers that computers can store. We can use floating point numbers to store decimals with up to 15 digits of precision. The int and float numbers that computers provide are sufficient for most practical computations, and you probably shouldn’t worry about the limited precision of computer number representations. Still, I want you to be aware of the distinction between the abstract mathematical concept of a number and its computer representation. The real number \sqrt{2} is irrational and has an infinite number of digits in its decimal expansion. On a computer, \sqrt{2} is represented as the approximation 1.41421356237310 (a float). For most purposes the approximation is okay, but sometimes the limited precision can show up in calculations. For example, float(sqrt(2))*float(sqrt(2)) = 2.0000000000000004 \neq 2 and float(0.1)+float(0.2) = 0.30000000000000004 \neq 0.3. The result of the computer’s calculation is only accurate up to the 15th digit. That’s pretty good if you ask me.

Scientific notation

In science we often work with very large numbers like the speed of light (299\,792\,458), and very small numbers like the permeability of free space (0.000001256637). It can be difficult to judge the magnitude of such numbers and to carry out calculations on them using the usual decimal notation.

Dealing with such numbers is much easier if we use scientific notation. The speed of light can be written as 2.99792458\times 10^{8}, and the permeability of free space is denoted as 1.256637\times 10^{-6}. In both cases, we express the number as a decimal number between 1.0 and 9.9999\ldots followed by the number raised to some exponent. The effect of multiplying by 10^8 is to move the decimal point eight steps to the right, making the number bigger. Multiplying by 10^{-6} has the opposite effect, moving the decimal point to the left by six steps and making the number smaller. Scientific notation is useful because it allows us to clearly see the size of numbers: 1.23\times 10^{6} is 1\,230\,000 whereas 1.23\times 10^{-10} is 0.000\,000\,000\,123. With scientific notation you don’t need to count the zeros!

The number of decimal places we use when specifying a certain physical quantity is usually an indicator of the precision with which we are able to measure this quantity. Taking into account the precision of the measurements we make is an important aspect of all quantitative research. Since elaborating further would be a digression, we won’t go into a full discussion about the topic of significant figures here. Feel free to read the Wikipedia article on the subject to learn more.

Computer systems represent numbers using scientific notation, too. When entering a floating point number into the computer, separate the decimal part from the exponent by the character e, which stands for “exponent.” For example, the speed of light is written as 2.99792458e8 and the permeability of free space is 1.256637e-6.

Exercises

E1.4 Compute the value of the following expressions:

a) \frac{1}{2} + \frac{1}{3} b) \frac{1}{2} + \frac{1}{3} + \frac{1}{4} c) 3\frac{1}{2} + 2 - \frac{1}{3}

Links

I encourage you to check the links provided below to learn more about numbers and number representations.

[ History of the Hindu–Arabic system for representing numbers ] https://en.wikipedia.org/wiki/Hindu–Arabic_numeral_system

[ Positional number representation systems ] https://en.wikipedia.org/wiki/Positional_notation

[ Decimal representation ] https://en.wikipedia.org/wiki/Decimal_representation

[ More details on scientific notation ] https://en.wikipedia.org/wiki/Scientific_notation

[ Info about significant figures calculations ] https://en.wikipedia.org/wiki/Significant_figures

1.4 Variables

In math we use a lot of variables and constants, which are placeholder names for any number or unknown. Variables allow us to perform calculations without knowing all the details.

Example

You’re having tacos for lunch today and wondering how many you can eat without going over your caloric budget. Your goal is to eat 800 calories for lunch and you want to do the calculation before getting to the restaurant because you fear your math abilities might be affected in the presence of tacos. You’re not sure how many calories each taco contains, so you invent the variable c to denote this unknown. You also define the variable x to represent the number of tacos you will eat, and come up with the equation 800=cx to represent the total number of calories of your lunch. Solving for x, you find the total number of tacos you should order is x = \frac{800}{c}. If the restaurant serves tacos that contain c=200 calories each, then you should order x = \frac{800}{200} = 4 of them. If the restaurant serves only giant tacos worth c=400 calories each, then you can only eat x = \frac{800}{400} = 2 of them. Observe we were able to solve for x even before knowing the value of c.

Variable names

There are common naming patterns for variables:

x: name used for the unknown in equations. We also use x to denote function inputs and the position of objects in physics.

i,j,k,m,n: common names for integer variables

a,b,c,d: letters near the beginning of the alphabet are often used to denote constants (fixed quantities that do not change).

\theta,\phi: the Greek letters theta and phi are used to denote angles

C: costs in business, along with P for profit, and R for revenue

X: capital letters are used to denote random variables in probability theory

Variable substitution

We can often change variables and replace one unknown variable with another to simplify an equation. For example, say you don’t feel comfortable around square roots. Every time you see a square root, you freak out until one day you find yourself taking an exam trying to solve for x in the following equation:

Don’t freak out! In crucial moments like this, substitution can help with your root phobia. Just write, “Let u=\sqrt{x}” on your exam, and voila, you can rewrite the equation in terms of the variable u:

which contains no square roots.

The next step to solve for u is to undo the division operation. Multiply both sides of the equation by (5-u) to obtain

which simplifies to

This can be rewritten as the equation u^2-5u+6=0, which in turn can be rewritten as (u-2)(u-3)=0 using the techniques we’ll learn in Section sec:solving_quadratic_equations.

We now see that the solutions are u_1=2 and u_2=3. The last step is to convert our u-answers into x-answers by using u=\sqrt{x}, which is equivalent to x = u^2. The final answers are x_1=2^2=4 and x_2=3^2=9. Try plugging these x values into the original square root equation to verify that they satisfy it.

Compact notation

Symbolic manipulation is a powerful tool because it allows us to manage complexity. Say you’re solving a physics problem in which you’re told the mass of an object is m=140 kg. If there are many steps in the calculation, would you rather use the number kg in each step, or the shorter symbol m? It’s much easier to use m throughout your calculation, and wait until the last step to substitute the value kg when computing the final numerical answer.

1.5 Functions and their inverses

As we saw in the section on solving equations, the ability to “undo” functions is a key skill for solving equations.

Example

Suppose we’re solving for x in the equation

where f is some function and c is some constant. We’re looking for the unknown x such that f(x) equals c. Our goal is to isolate x on one side of the equation, but the function f stands in our way.

By using the inverse function (denoted f^{-1}) we “undo” the effects of f. We apply the inverse function f^{-1} to both sides of the equation to obtain

By definition, the inverse function f^{-1} performs the opposite action of the function f, so together the two functions cancel each other out. We have f^{-1}(f(x))=x for any number x.

Provided everything is kosher (the function f^{-1} must be defined for the input c), the manipulation we made above is valid and we have obtained the answer x=f^{-1}(c).

The above example introduces the notation f^{-1} for denoting the inverse function. This notation is inspired by the notation for reciprocals. Recall that multiplication by the reciprocal number a^{-1} is the inverse operation of multiplication by the number a: a^{-1}ax=1x=x. In the case of functions, however, the negative-one exponent does not refer to “one over-f(x)” as in \frac{1}{f(x)}=(f(x))^{-1}; rather, it refers to the inverse function. In other words, the number f^{-1}(y) is equal to the number x such that f(x)=y. Be careful: sometimes an equation can have multiple solutions. For example, the function f(x)=x^2 maps two input values (x and -x) to the same output value x^2=f(x)=f(-x). The inverse function of f(x)=x^2 is f^{-1}(y)=\sqrt{y}, but both x=+\sqrt{c} and x=-\sqrt{c} are solutions to the equation x^2=c. In this case, this equation’s solutions can be indicated in shorthand notation as x=\pm \sqrt{c}.

Formulas

Here is a list of common functions and their inverses:

The function-inverse relationship is symmetric—if you see a function on one side of the above table (pick a side, any side), you’ll find its inverse on the opposite side.

Don’t be surprised to see -1x \; \Leftrightarrow -1x in the list of function inverses. Indeed, the opposite operation of multiplying by -1 is to multiply by -1 once more: (-(-x) = x).

Example 1

If you want to solve the equation x-4 = 5, you can apply the inverse function of x-4, which is x + 4. After adding four to both sides of the equation, x-4+4 = 5 +4, we obtain the answer x = 9.

Example 2

Let’s say your teacher doesn’t like you and right away, on the first day of class, he gives you a serious equation and tells you to find x:

See what I mean when I say the teacher doesn’t like you?

First, note that it doesn’t matter what \Psi (the Greek letter psi) is, since x is on the other side of the equation. You can keep copying \Psi(1) from line to line, until the end, when you throw the ball back to the teacher. “My answer is in terms of your variables, dude. You go figure out what the hell \Psi is since you brought it up in the first place!” By the way, it’s not actually recommended to quote me verbatim should a situation like this arise. The same goes with \sin(8). If you don’t have a calculator handy, don’t worry about it. Keep the expression \sin(8) instead of trying to find its numerical value. In general, try to work with variables as much as possible and leave the numerical computations for the last step.

Okay, enough beating about the bush. Let’s just find x and get it over with! On the right-hand side of the equation, we have the sum of a bunch of terms with no x in them, so we’ll leave them as they are. On the left-hand side, the outermost function is a logarithm base . Cool. Looking at the table of inverse functions, we find the exponential function is the inverse of the logarithm: a^x \Leftrightarrow \log_a(x). To get rid of \log_5, we must apply the exponential function base 5 to both sides:

which simplifies to

since 5^x cancels \log_5 x.

From here on, it is going to be as if Bruce Lee walked into a place with lots of bad guys. Addition of is undone by subtracting on both sides:

To undo a square root we take the square:

Add to both sides,

divide by

and square again to find the final answer:

Did you see what I was doing in each step? Next time a function stands in your way, hit it with its inverse so it knows not to challenge you ever again.

Discussion

The recipe I have outlined above is not universally applicable. Sometimes x isn’t alone on one side. Sometimes x appears in several places in the same equation. In these cases, you can’t effortlessly work your way, Bruce Lee-style, clearing bad guys and digging toward x—you need other techniques.

The bad news is there’s no general formula for solving complicated equations. The good news is the above technique of “digging toward the x” is sufficient for 80% of what you are going to be doing. You can get another 15% if you learn how to solve the quadratic equation:

We’ll show a formula for solving quadratic equations in Section sec:solving_quadratic_equations. Solving cubic equations like ax^3+bx^2+cx+d=0 using a formula is also possible, but at this point you might as well start using a computer to solve for the unknowns. See page 9.1.11 in Appendix 1.

There are all kinds of other equations you can learn how to solve: equations with multiple variables, equations with logarithms, equations with exponentials, and equations with trigonometric functions. The principle of “digging” toward the unknown by applying inverse functions is the key for solving all these types of equations, so be sure to practice using it.

Exercises

E1.5 Solve for x in the following equations:

a) 3x=6 b) \log_5(x)=2 c) \log_{10}(\sqrt{x})=1

E1.6 Find the function inverse and use it to solve the problems.

a)

 Solve the equation f(x)=4, where f(x)= \sqrt{x}.

b)

 Solve for x in the equation g(x)=1, given g(x)= e^{-2x}.

Chapter 2 Algebra

The rules of algebra tell us how to manipulate math expressions. By observing and working with the structure of expressions, we can simplify them, and thus compute their values more easily. In this chapter we’ll learn the general rules that apply to all math expressions. Knowing these rules will equip you with a powerful toolbox of tricks you can apply to any problem you might face.

In Section 1.1, we learned how to isolate the unknown x in equations, which is by far the most important technique for solving equations. In this chapter we’ll learn a few more techniques, including how to simplify, expand, and factor expressions. Together, these techniques are called algebra, from the Arabic al-jabr meaning “reunion of broken parts.”

In Section sec:solving_quadratic_equations, we’ll use algebra to derive a general formula for solving quadratic equations of the form ax^2+bx+c=0. Knowing how to solve quadratic equations is really important because they show up all over the place.

Alright! Are you ready for algebra? Let’s get started!

2.1 Basic rules of algebra

It’s important that you know the general rules for manipulating numbers and variables, a process otherwise known as—you guessed it—algebra. This little refresher will cover these concepts to make sure you’re comfortable on the algebra front. We’ll also review some important algebraic tricks, like factoring and completing the square, which are useful when solving equations.

Let’s define some terminology for referring to different parts of math expressions. When an expression contains multiple things added together, we call those things terms. Furthermore, terms are usually composed of many things multiplied together. When a number x is obtained as the product of other numbers like x=abc, we say “x factors into a, b, and c.” We call a, b, and c the factors of x.

Figure 2.1: Diagram showing the names used to describe the different parts of the equation abc+de=0.

Given any three numbers a, b, and c, we can apply the following algebraic properties:

Associative property: a+b+c=(a+b)+c=a+(b+c) and abc=(ab)c=a(bc)

Commutative property: a+b=b+a and ab=ba

Distributive property: a(b+c)=ab+ac

We use the distributive property every time we expand brackets. For example a(b+c+d)=ab + ac + ad. The brackets, also known as parentheses, indicate the expression (b+c+d) must be treated as a whole; as a factor consisting of three terms. Multiplying this expression by a is the same as multiplying each term by a.

The opposite operation of expanding is called factoring, which consists of rewriting the expression with the common parts taken out in front of a bracket: ab+ac = a(b+c). In this section, we’ll discuss all algebra operations and illustrate what they’re capable of.

Example

Suppose we are asked to solve for t in the equation

Since the unknown t appears on both sides of the equation, it is not immediately obvious how to proceed.

To solve for t, we can bring all t terms to one side and all constant terms to the other side. First, expand the two brackets to obtain

Then move things around to relocate all ts to the equation’s right-hand side and all constants to the left-hand side:

We see t is contained in both terms on the right-hand side, so we can “factor it out” by rewriting the equation as

The answer is within close reach: t = \frac{21 + 44}{66 - 28} = \frac{65}{38}.

[CONTENT OMITTED IN PREVIEW]

Chapter 3 Exponents and logarithms

Understanding exponents and logarithms is important for your math modelling skills. Exponential functions can describe population growth, interest calculations on loans, probabilities of random events, voltages in electric capacitors, radioactive decay, and many other phenomena.

The logarithmic function is the inverse of the exponential function. We need the logarithmic function every time we want to solve an equation containing exponents. Additionally, the logarithmic scale allows us to conveniently compare numbers of vastly different sizes. Logarithmic scales are used to describe systems with exponential scale differences, including sound intensity and the acidity of chemical solutions.

As a student of math, you can consider exponentiation and logarithm computation as basic operations, on the same footing as addition, subtraction, multiplication, and division.

In this chapter, you’ll learn the basic rules for manipulating exponents and logarithms. As you read and practice, your job is to make sure you’re just as comfortable with exponents as you are with addition and multiplication, and as comfortable with logarithms as you are with subtraction and division.

[CONTENT OMITTED IN PREVIEW]

Chapter 4 Coordinate systems

Numbers have a dual nature: they’re simultaneously abstract mathematical concepts and concrete real-world quantities. The number four corresponds to the abstract concept of “fourness” that is shared by all groups of four objects, but four can also be represented as the length of a four-metre-long wooden pole. This dual nature of numbers is what makes them so useful: we can use numbers and algebra to solve real-world problems, and also visualize abstract algebra problems in terms of real-world lengths. If you want to know the combined length of a four-metre pole and a two-metre pole, you can perform the calculation using numbers inside your head, without needing to move any real poles. Alternatively, you can learn about the abstract concepts of addition and multiplication by manipulating physical objects.¹

It is possible to add more “dimensions” to the correspondence between numbers and lengths. The Cartesian plane is a two-dimensional coordinate system that assigns a pair of coordinates (x,y) to every point in a two-dimensional plane. In this chapter we’ll discuss this important visualization tool that will support your understanding of functions (Chapter 5), geometry (Chapter 6), and vectors (Chapter 7).

Many important math ideas can be expressed visually as two-dimensional pictures, geometric shapes, and curves. The same math ideas can also be described by abstract math concepts like numbers and equations. Coordinate systems serve as the bridge between the space you can visualize and the space of abstract math concepts like coordinates and equations.

[CONTENT OMITTED IN PREVIEW]

1. For example, playing with Cuisenaire rods is an excellent way to become familiar with numbers and math operations.

Chapter 5 Functions

Learning math is like learning a new language. One of the most useful ideas you can learn in the language of math is the concept of a function. If numbers and variables correspond to nouns, functions correspond to verbs. Specifically, functions codify relations between variables; any relationship between two variables can be expressed as a function. This makes functions a powerful tool for modelling real-world situations.

In this chapter we’ll learn some important math verbs. We’ll start with some general theory about functions, then catalogue the most important functions that occur in everyday life, in scientific modelling, and in business. We’re building your vocabulary of math action verbs so you’ll be able to get in on the action.

In Section sec:functions we’ll introduce the main concepts used to characterize functions: the function’s domain and image, the function’s graph, and the function’s values. Section sec:functions_reference serves as a reference manual for 10 functions of central importance in math, science, and engineering. In Section sec:function_transformations we’ll observe how translation and scaling transformations affect the functions’ graphs.

[CONTENT OMITTED IN PREVIEW]

Chapter 6 Geometry

Geometry is the mathematical study of shapes and proportions. This branch of mathematics encompasses all things that can be drawn and analyzed using geometric concepts like similarity, proportionality, and orthogonality. Geometry studies the common, abstract nature of all geometrical shapes. For example, instead of studying and describing the properties of any particular triangle, we’ll study the geometrical properties common to all triangles.

We won’t just look at shapes; we’ll develop a language for describing them quantitatively in terms of lengths and angles. We can find patterns in different geometric shapes and describe proportions and lengths using equations.

Here’s the chapter breakdown. In Section sec:geometry, we’ll discuss properties of several geometric shapes: triangles, circles, cylinders, spheres, cones, and pyramids. Sections sec:trigonometry and sec:trigonometric_identities discuss the topic of trigonometry, which is the study of the proportions of the sides of right-angle triangles. We’ll learn all about the trigonometric functions \sin \theta and \cos \theta, which play an important role in many areas of mathematics. In Section sec:circle we’ll learn more about circles and polar coordinates. Sections sec:ellipse, sec:parabola, and sec:hyperbola will discuss the ellipse, the parabola, and the hyperbola, which are three other interesting geometric shapes that occur in nature.

[CONTENT OMITTED IN PREVIEW]

Chapter 7 Vectors

In this chapter we’ll learn how to manipulate multi-dimensional objects called vectors. Vectors are the precise way to describe directions in space. We need vectors in order to describe physical quantities like forces, velocities, and accelerations.

Vectors are built from ordinary numbers, which form the components of the vector. You can think of a vector as a list of numbers, and vector algebra as operations performed on the numbers in the list. Vectors can also be manipulated as geometric objects, represented by arrows in space. For instance, the arrow that corresponds to the vector \vec{v}=(v_x,v_y) starts at the origin (0,0) and ends at the point (v_x,v_y). The word vector comes from the Latin vehere, which means to carry. Indeed, the vector \vec{v} takes the point (0,0) and carries it to the point (v_x,v_y).

Figure 7.1: The vector \vec{v}=(3,2) is an arrow in the Cartesian plane. The horizontal component of \vec{v} is v_x=3 and the vertical component is v_y=2.

This chapter will introduce you to vectors, vector algebra, and vector operations, which are very useful for solving physics problems. What you’ll learn here applies more broadly to current problems in computer graphics, probability theory, machine learning, and other fields of science and mathematics. It’s all about vectors these days, so you’d best get to know them.

Figure 7.2: This figure illustrates the new concepts related to vectors. As you can see, there is quite a bit of new vocabulary to learn, but don’t be fazed—all these terms are just fancy ways of talking about arrows.

[CONTENT OMITTED IN PREVIEW]

Chapter 8 Extra topics

Learning all of mathematics would require several lifetimes. There is so much to learn: applied math, abstract theoretical math, numerical methods, and many other subfields and specialties. It’s up to you to choose how much you want to learn. As an adult learner there will be no exams to force you to study, so if you’re learning something it’s because you want to know!

Out of the thousands of possible math topics you could learn next, I’ve selected a shortlist of three important topics to get you started. In Section sec:solving_systems_of_linear_equations we’ll explore how to solve equations with multiple unknowns. Specifically, we’ll focus on systems of k linear equations that contain k unknowns. For example, the system of equations

consists of two equations that contain two unknowns: s and t. There is a systematic procedure you can follow to combine the equations and reduce the problem to a single equation with a single unknown

which you know how to solve. In the end, we find the unknowns s and t that satisfy both equations are s=1 and t=2.

In Section sec:compound_interest, we’ll learn about the compound interest calculations used by banks to compute the interest owed on loans. It’s important to understand the math so you can calculate the cost of borrowing for different interest rates and compounding methods. This topic is particularly relevant for students who are considering taking out student loans. Think of this math knowledge as financial self-defence.

Finally, in Section sec:set_notation, we’ll introduce sets and set notation. Mathematicians often use symbols like \in (element of), \subset (subset of), \forall (for all), and \exists (there exists), to make very concise math statements and definitions. We managed to get through the entire book without the need for these “alien symbols,” but knowing set notation is important for your future math studies. Most advanced math textbooks assume readers are familiar with these symbols, so it’s a good idea to know what the symbols mean.

[CONTENT OMITTED IN PREVIEW]

Chapter 9 Practice problems

We’ve now reached the problems chapter in this book. The purpose of these problems is to give you a way to comprehensively practice your math fundamentals. Knowing how to solve math problems is a very useful skill to develop. At times, honing your math chops might seem like tough mental work, but at the end of each problem, you’ll gain a stronger foothold on all the topics you’ve been learning about. You’ll also experience a small achievement buzz after each problem you vanquish.

Sit down and take a crack at these practice problems today, or another time when you’re properly caffeinated. If you make time for some math practice, you’ll develop long-lasting comprehension and true math fluency.

Without solving any problems, you’re likely to forget most of what you’ve learned in the next few months. You might still remember the big ideas, but the details will be fuzzy and faded. By solving some of the practice problems, you’ll remember a lot more stuff. Don’t break the pace now: with math, it’s very much use it or lose it!

Make sure you put your phone away while you’re working on the problems. You don’t need fancy technology to do math; grab a pen and some paper from the printer and you’ll be fine. The great mathematicians like Descartes, Hilbert, Leibniz, and Noether did most of their work with pen and paper and they did well. Spend some time with math the way they did.

P9.1 Solve for x in the equation x^2-9=7.

P9.2 Solve for x in the equation \cos^{-1}\!\left( \frac{x}{A} \right) - \phi = \omega t.

P9.3 Solve for x in the equation \frac{1}{x}=\frac{1}{a}+\frac{1}{b}.

P9.4 Use a calculator to find the values of the following expressions:

a) \sqrt[4]{3^3} b) 2^{10} c) 7^{^{\frac{1}{4}}}-10 d) \frac{1}{2}\ln(e^{22})

P9.5 Compute the following expressions involving fractions:

a) \dfrac{1}{2} + \dfrac{1}{4} b) \dfrac{4}{7} - \dfrac{23}{5} c) 1\frac{3}{4} + 1\frac{31}{32}

P9.6 Use the basic rules of algebra to simplify the following expressions:

a) ab\,\dfrac{1}{a}\,b^2cb^{-3} b) \dfrac{abc}{bca} c) \dfrac{27a^2}{\sqrt{9abba}}

d) \dfrac{a(b+c) - ca}{b} e) \dfrac{a}{c\sqrt[3]{b}}\dfrac{b^{\frac{4}{3}} }{a^2} f) (x+a)(x+b)\!-x(a+b)

P9.7 Expand the brackets in the following expressions:

a) (x+a)(x-b) b) (2x+3)(x-5) c) (5x-2)(2x+7)

[CONTENT OMITTED IN PREVIEW]

End matter

Conclusion

We covered many fundamental concepts during this hike in the math mountains. We started with basic math ideas like variables, expressions, and equations, and then moved into algebra—hopefully you’ll agree with me that algebra is not as scary as some people think, right? We covered many other scary topics like exponents and logarithms, and you made it through unscathed. We even tackled more advanced topics like functions, vectors, complex numbers, proofs, and set notation. Congratulations on powering through this intensive math bootcamp!

The only way to truly understand math is to apply math concepts to solving problems. You don’t get points for memorizing rules, formulas, and equations; only when you learn how to use the equations will you truly “own” the math. Math is not a spectator sport! If you’re reading this book without solving the practice problems, you’re getting a bad deal. If you haven’t attempted to solve the problems in Chapter 9, you need to turn back and give them a shot.

My intention with this book was to give you a solid, basic understanding of many mathematical concepts, explained quickly and simply so you wouldn’t get bored. However, it’s possible that the book’s fast pace led to some gaps in the coverage of the material. Let me know if you find any parts of the book that lack clarity or are missing explanations. Send me an email if you find a confusing explanation, a missing definition, or an equation you think is wrong. You can reach me at  ivan@minireference.com. The book’s relative errorlessness is thanks to the many typo fixes, bug reports, and helpful suggestions I receive from readers like you.

To learn more about other books in the No Bullshit Guide series and find out how Minireference Co. is revolutionizing the textbook industry, visit our blog at minireference.com/blog. You can also find us on the twitter  @minireference  and on the facebook  fb.me/noBSguide.

Acknowledgments

This book would not have been possible without the support and encouragement of the people around me. First and foremost of the many people to thank are my parents, who have supported my life choices, and from whom I’ve learned many things. Next are all my teachers. I thank my CEGEP teachers: Karnig Bedrossian from whom I learned calculus, Paul Kenton from whom I learned how to think about physics in a chill manner, and Benoit Larose who taught me that more dimensions does not mean things get more complicated. I thank Kohur Gowrisankaran, Frank Ferrie, Mourad El-Gamal, and Ioannis Psaromiligkos for their teaching during my engineering days, and Guy Moore and Zaven Altounian for teaching me advanced physics topics. Among all my teachers, I owe the most to Patrick Hayden whose teaching methods have always inspired me. From him, I learned that by defining things clearly, you can trick students into learning advanced topics, and even make it seem like the results are obvious! Thanks go out to all my research collaborators and friends: David Avis, Arlo Breault, Juan Pablo Di Lelle, Omar Fawzi, Adriano Ferrari, Mohamad Nizar Kezzo, Igor Khavkine, Felix Kwok, Doina Precup, Andie Sigler, and Mark M. Wilde. Thank you all for teaching me a great many things.

Preparing this book took many years and the combined efforts of many people. I want to thank Afton Lewis, Oleg Zhoglo, Georger Araujo, and Tomasz Święcicki for helping me proofread, and all the readers who reported typos and suggested clarifications. Thank you all for your comments and feedback. Above all, I want to thank my editor Sandy Gordon, who helped me substantially improve the writing in the book. Her expertise with the English language and her advice on style and content have been absolutely invaluable.

Last but not least, I want to thank all my students for their endless questions, demand for explanations, and curiosity. If I’ve developed any ability to explain things, I owe it to them.

Further reading

You’ve reached the end of this book, but you’re only at the beginning of the journey of mathematical discovery. There are many things left for you to learn about. Below are some recommendations of subjects you might find interesting.

Newtonian mechanics

Newton’s laws of physics provide an excellent example of the scientific approach to understanding and modelling the world around us. Using a few basic laws, it’s possible to build accurate models for the motion of objects in terms of concepts like position, velocity, acceleration, momentum, and energy. It’s no surprise mechanics is a foundational subject of science.

Since you know basic math, it will be easy for you to understand the laws of physics. Indeed, most physics laws are expressed as mathematical equations. If you know how to manipulate equations and solve for the unknowns in them, then you already know half of physics. If you previously avoided this subject out of fear, now would be a great time to revisit it. Learning physics is an excellent source of knowledge buzz.

By learning how to solve complicated physics problems, you’ll also develop your analytical skills. Later, you can apply these skills to other areas of life. Even if you don’t go on to study science, the expertise you develop in solving physics problems will help you tackle complicated problems in general.

[TUTORIAL] Ivan Savov. Mechanics explained in seven pages, 2017, see minireference.com/static/tutorials/mech_in_7_pages.pdf.

[BOOK] Ivan Savov. No Bullshit Guide to Math & Physics, Minireference Publishing, Fifth edition, 2014, 978-0-9920010-0-1.

Calculus

Calculus is the language of quantitative science. Many of the fundamental laws of physics, chemistry, biology, and economics are expressed in the language of calculus. A solid grasp of this subject is essential for anyone interested in pursuing university-level studies in science, engineering, or business.

The new knowledge you’ll develop in calculus involves analyzing the properties of functions. You’ll learn to describe how functions change over time (derivatives), and how to calculate the total amount of a quantity that accumulates over a time period (integrals). The language of calculus will allow you to speak precisely about the different properties of functions, and better understand their behaviour. You will learn how to calculate the slopes of functions, how to find their maximum and minimum values, how to compute their integrals, and other tasks of practical importance. In addition to its practical applications, learning calculus will also expose you to the concept of infinity. Calculus thinking requires understanding infinitely small numbers, infinitely large numbers, and computations with an infinite number of steps.

If you liked the math in this book, I encourage you to continue your journey with the No Bullshit Guide to Math & Physics, which will teach you the topics of mechanics, differential calculus, and integral calculus in an integrated manner, highlighting the connections between them, and discussing their applications.

[BOOK] Ivan Savov. No Bullshit Guide to Math & Physics, Minireference Publishing, Fifth edition, 2014, 978-0-9920010-0-1.

The calculus book by Thompson is also worth checking out.

[BOOK] Silvanus P. Thompson. Calculus Made Easy, Macmillian and Co., Second edition, 1914, http://gutenberg.org/ebooks/33283.

You can also learn calculus from these excellent video lessons.

[VIDEOS] Grant Sanderson (3Blue1Brown), Essence of calculus, YouTube playlist, 2018, online: https://bit.ly/3Blue1BrownCalc.

[VIDEO LECTURES] Gilbert Strang. Highlights of Calculus, MIT OpenCourseWare, 2010, see https://bit.ly/StrangCalcLectures.

Linear algebra

Learning linear algebra will open many doors for you. You need linear algebra to understand statistics, computer graphics, machine learning, quantum mechanics, and many other areas of science and business.

Here’s a little preview. Linear algebra is the study of vectors \vec{v} \in \mathbb{R}^n and linear transformations . Linear transformations are vector functions that obey the linear property T(\alpha \vec{v}_1 + \beta\vec{v}_2) = \alpha T(\vec{v}_1) + \beta T(\vec{v}_2). Using the standard notation for functions, we write T(\vec{x})=\vec{y} to show the linear transformation T acting on an input vector \vec{x} \in \mathbb{R}^n to produce the output vector \vec{y} \in \mathbb{R}^m. Every linear transformation T can be represented as a matrix A_T \in \mathbb{R}^{m \times n}, which is an array of numbers with m rows and n columns. Computing T(\vec{x}) is equivalent to computing the matrix-vector product A_T\vec{x}. Because of the equivalence between linear transformations and matrices, we can also say that linear algebra is the study of vectors and matrices.

Vectors and matrices are used all over the place! If your knowledge of high-school math gave you modelling superpowers, then linear algebra is the vector-upgrade that teaches you how to build models in multiple dimensions.

[VIDEO LECTURES] Gilbert Strang. Linear Algebra, MIT OpenCourseWare, 2010, online: http://bit.ly/StrangLAlectures.

[BOOK] Ivan Savov. No Bullshit Guide to Linear Algebra, Minireference Publishing, Second edition, 2017, ISBN 978-0-9920010-2-5.

Probability

Probability distributions are a fundamental tool for modelling non-deterministic behaviour. A discrete random variable X is associated with a probability mass function p_X(x) \eqdef \textrm{Pr}(\{ X = x \}), which assigns a “probability mass” to each of the possible outcomes of the random variable X. For example, if X represents the outcome of the throw of a fair die, then the possible outcomes are \mathcal{X}=\{ 1, 2, 3, 4, 5, 6 \} and the probability mass function has the values p_X(x)=\frac{1}{6}, \forall x \in \mathcal{X}.

Probability distributions and random variables allow us to model random processes like the roll of a die. We can’t predict the exact outcome when two dice X_1 and X_2 are rolled, but we can predict the probability of different outcomes. For example, the “pair of sixes” outcome is described by the event \{ X_1 + X_2 = 12 \}. Assuming the dice are fair, this outcome has probability \textrm{Pr}(\{ X_1 + X_2 = 12\}) = \frac{1}{36}.

Probability theory is used all over the place, including in statistics, machine learning, quantum mechanics, and risk analysis.

[BOOK] Charles M. Grinstead and J. Laurie Snell. Introduction to Probability, AMS, 2006, https://bit.ly/GrinsteadSnellProb.

General mathematics

Mathematics is a hugely broad field. There are all kinds of topics to learn about; some of them are fun, some of them are useful, and some of them are totally mind expanding.

The following resources cover math topics of general interest and serve as a great overview of all areas of mathematics. I highly recommend you take a look at these for further math enlightening.

[VIDEO] A map of mathematics that shows all the subfields of mathematics and their objects of study: https://youtu.be/OmJ-4B-mS-Y.

[VIDEOS] Video interviews and lessons by some of the best math educators in the world: https://youtube.com/user/numberphile.

[BOOK] Alfred North Whitehead. An Introduction to Mathematics, Williams & Norgate, 1911, www.gutenberg.org/ebooks/41568.

General physics

If you want to learn more about physics, I highly recommend the Feynman lectures on physics. This three-tome collection covers all of undergraduate physics and explains many more advanced topics.

[BOOK] Richard P. Feynman. The Feynman Lectures on Physics, The Definitive and Extended Edition, Addison Wesley, 2005, ISBN 0805390456. Read online at: http://feynmanlectures.caltech.edu

Final words

Throughout this book, I strived to equip you with the basic math tools you’ll need to make your future studies enjoyable and pain free. Remember to always take it easy. Never be afraid of math. Never take math exams too seriously. Play with math equations and try different approaches—the worst that can happen is you’ll need another piece of paper. Grades don’t matter. Big paycheques don’t matter. Never settle for a boring job just because it pays well, and try to work only on projects you truly care about.

Along the way, I want you to be confident in your ability to handle any complicated math that life might throw at you. You have the tools to do anything you want; choose your own adventure.

Answers and solutions

Chapter 1 solutions

Answers to exercises

E1.1 a) x=3; b) x=30; c) x=2; d) x=-3. E1.2 a) \mathbb{Z}, \mathbb{Q}, \mathbb{R},\mathbb{C}; b) \mathbb{C}; c) \mathbb{N},\mathbb{Z}, \mathbb{Q}, \mathbb{R},\mathbb{C}; d) \mathbb{Q}, \mathbb{R},\mathbb{C}; e) \mathbb{R},\mathbb{C}. E1.3 a) ; b) ; c) \frac{2}{27}. E1.4 a) \frac{5}{6}; b) \frac{13}{12} = 1\frac{1}{12}; c) \frac{31}{6}=5\frac{1}{6}. E1.5 a) x=2; b) x=25; c) x=100. E1.6 a) f^{-1}(x)=x^2, x=16. b) g^{-1}(x)=-\frac{1}{2}\ln(x), x=0.

Solutions to selected exercises

E1.4 a) To compute \frac{1}{2} + \frac{1}{3}, we rewrite both fractions using the common denominator , then compute the sum: \frac{1}{2} + \frac{1}{3}=\frac{3}{6}+\frac{2}{6}=\frac{5}{6}. b) You can use the answer from part (a), or compute the triple sum directly by setting all three fractions to a common denominator: \frac{1}{2} + \frac{1}{3} + \frac{1}{4}=\frac{6}{12} + \frac{4}{12} + \frac{3}{12}=\frac{13}{12}. c) Here we first rewrite 3\frac{1}{2} as \frac{7}{2}, then use the common denominator for the computation: \frac{7}{2} + 2 - \frac{1}{3} = \frac{21}{6} + \frac{12}{6} - \frac{2}{6}=\frac{31}{6}.

Chapter 9 solutions

Answers to problems

P9.1 x=\pm 4. P9.2 x=A\cos(\omega t+\phi). P9.3 x=\frac{ab}{a+b}. P9.4 a) 2.2795. b) . c) -8.373. d) . P9.5 a) \frac{3}{4}. b) \frac{-141}{35}. c) 3\frac{23}{32}. P9.6 a) c. b) . c) \frac{9|a|}{|b|}. d) a. e) \frac{b}{ac}. f) x^2+ab. P9.7 a) x^2 + (a-b)x -ab. b) 2x^2 -7x -15. c) 10x^2 + 31x - 14.

Solutions to selected problems

P9.5 For c), 1\frac{3}{4} + 1\frac{31}{32} = \frac{7}{4} + \frac{63}{32} = \frac{56}{32} + \frac{63}{32} = \frac{119}{32}=3\frac{23}{32}.

Notation

This appendix contains a summary of the notation used in this book.

Math notation

Expression | Read as | Used to denote
a,b,x,y |  | variables
= | is equal to | expressions that have the same value
\eqdef | is defined as | a new variable definition
a+b | a plus b | the combined lengths of a and b
a-b | a minus b | the difference in lengths between a and b
a\times b = ab | a times b | the area of a rectangle
a^2= aa | a squared | the area of a square of side length a
a^3= aaa | a cubed | the volume of a cube of side length a
a^n | a to the n | a multiplied by itself n times
\sqrt{a} = a^{\frac{1}{2}} | square root of a | the side length of a square of area a
\sqrt[3]{a}= a^{\frac{1}{3}} | cube root of a | the side length of a cube with volume a
a/b = \frac{a}{b} | a divided by b | a parts of a whole split into b parts
a^{-1}= \frac{1}{a} | one over a | division by a
f(x) | f of x | the function f applied to input x
f^{-1} | f inverse | the inverse function of f(x)
f \circ g | f compose g | function composition; f \circ g(x) = f(g(x))
e^x | e to the x | the exponential function base e
\ln(x) | natural log of x | the logarithm base e
a^x | a to the x | the exponential function base a
\log_a(x) | log base a of x | the logarithm base a
\theta,\phi | theta, phi | angles
\sin,\cos,\tan | sin, cos, tan | trigonometric ratios
\% | percent | proportions of a total; a\%=\frac{a}{100}

Set notation

You don’t need a lot of fancy notation to understand mathematics. It really helps, though, if you know a little bit of set notation.

Symbol | Read as | Denotes
\{ \; \ldots \; \} | the set \ldots | define a sets
| | such that | describe or restrict the elements of a set
\mathbb{N} | the naturals | the set \mathbb{N}\eqdef\{0,1,2,\ldots\}. Note \mathbb{N}^*\! \eqdef \mathbb{N}\! \setminus \!\{ 0\}.
\mathbb{Z} | the integers | the set \mathbb{Z}\eqdef\{\ldots,-2,-1,0,1,2,3,\ldots\}
\mathbb{Q} | the rationals | the set of fractions of integers
\mathbb{R} | the reals | the set of real numbers
\mathbb{C} |  | the set of complex numbers
\subset | subset | one set strictly contained in another
\subseteq | subset or equal | containment or equality
\cup | union | the combined elements from two sets
\cap | intersection | the elements two sets have in common
S\setminus T | S set minus T | the elements of S that are not in T
a\in S | a in S | a is an element of set S
a\notin S | a not in S | a is not an element of set S
\forall x | for all x | a statement that holds for all x
\exists x | there exists x | an existence statement
\nexists x | there doesn’t exist x | a non-existence statement

An example of a condensed math statement that uses set notation is “\nexists m, n \in \mathbb{Z} such that \frac{m}{n}=\sqrt{2},” which reads “there don’t exist integers m and n whose ratio equals \sqrt{2}.” Since we identify the set of fractions of integers with the rationals, this statement is equivalent to the shorter “\sqrt{2} \notin \mathbb{Q},” which reads “\sqrt{2} is irrational.”

Complex numbers notation

Expression |  | Denotes
\mathbb{C} |  | the set of complex numbers \mathbb{C} \eqdef \{ a + bi \; | \; a,b \in \mathbb{R} \}
i |  | the unit imaginary number i \eqdef \sqrt{-1} or i^2 = -1
\textrm{Re}\{ z \}=a |  | real part of z=a+bi
\textrm{Im}\{ z \}=b |  | imaginary part of z=a+bi
|z|\angle \varphi_z |  | polar representation of z = |z|\cos\varphi_z + i|z|\sin\varphi_z
|z|=\sqrt{a^2+b^2} |  | magnitude of z=a+bi
\varphi_z=\tan^{-1}(b/a) |  | phase or argument of z=a+bi
\overline{z}=a-bi |  | complex conjugate of z=a+bi

Vectors notation

Expression |  | Denotes
\mathbb{R}^{n} |  | the set of n-dimensional vectors
\vec{v} |  | a vector
(v_x,v_y) |  | vector in component notation
v_x\hat{\imath}+v_y\hat{\jmath} |  | vector in unit vector notation
\|\vec{v}\|\angle \theta |  | vector in length-and-direction notation
\|\vec{v}\| |  | length of the vector \vec{v}
\theta |  | angle the vector \vec{v} makes with the x-axis
\hat{v}\eqdef \frac{\vec{v}}{ \| \vec{v} \|} |  | unit vector in the same direction as \vec{v}
\vec{u} \cdot \vec{v} |  | dot product of the vectors \vec{u} and \vec{v}
\vec{u} \times \vec{v} |  | cross product of the vectors \vec{u} and \vec{v}

SymPy tutorial

Computers can be very useful for dealing with complicated math expressions or when slogging through tedious calculations. Throughout this book we used SymPy to illustrate several math concepts. We’ll now review all the math tools available through the SymPy command line. Don’t worry if you’re not a computer person; we’ll only discuss concepts we covered in the book, and the computer commands we’ll learn are very similar to the math operations you’re already familiar with. This section also serves as a final review of the material covered in the book.

Introduction

You can use a computer algebra system (CAS) to manipulate complicated math expressions and solve any equation.

All computer algebra systems offer essentially the same functionality, so it doesn’t matter which system you use: there are free systems like SymPy, Magma, or Octave, and commercial systems like Maple, MATLAB, and Mathematica. This tutorial is an introduction to SymPy, which is a symbolic computer algebra system written in the programming language Python. In a symbolic CAS, numbers and operations are represented symbolically, so the answers obtained are exact. For example, the number \sqrt{2} is represented in SymPy as the object Pow(2,1/2), whereas in numerical computer algebra systems like Octave, the number \sqrt{2} is represented as the approximation 1.41421356237310 (a float). For most purposes the approximation is okay, but sometimes approximations can lead to problems: float(sqrt(2))*float(sqrt(2)) = 2.00000000000000044 \neq 2. Because SymPy uses exact representations, you’ll never run into such problems: Pow(2,1/2)*Pow(2,1/2)= 2.

This tutorial presents many explanations as code snippets. Be sure to try the code examples on your own by typing the commands into SymPy. It’s always important to verify for yourself!

Using SymPy

The easiest way to use SymPy, provided you’re connected to the internet, is to visit http://live.sympy.org. You’ll be presented with an interactive prompt into which you can enter your commands—right in your browser.

If you want to use SymPy on your own computer, you must first install Python and the Python package sympy. You can then open a command prompt and start a Python session using:

you@host> python
Python X.Y.Z
[GCC a.b.c (Build Info)] on platform
Type "help", "copyright", or "license" for more information.
>>>

The >>> prompt indicates you’re in the Python shell which accepts Python commands. Type the following in the Python shell:

>>> from sympy import *
>>>

The command from sympy import *\; imports all the SymPy functions into the current namespace. All SymPy functions are now available to you. To exit the python shell press CTRL+D.

For an even better experience, you can try jupyter notebook, which is a web interface for accessing the Python shell. Search the web for “jupyter notebook” and follow the installation instructions specific to your operating system. It’s totally worth it!

begins with a python import statement for the functions used in that section. If you use the statement from sympy import *   in the beginning of your code, you don’t need to run these individual import statements, but I’ve included them so you’ll know which SymPy vocabulary is covered in each section.

Fundamentals of mathematics

Let’s begin by learning about the basic SymPy objects and the operations we can carry out on them. We’ll learn the SymPy equivalents of many math verbs like: “to solve” (an equation), “to expand” (an expression), “to factor” (a polynomial).

Numbers

>>> from sympy import  sympify, S, evalf, N

In Python, there are two types of number objects: ints and floats.

>>> 3
3                             # an int
>>> 3.0
3.0                           # a float

Integer objects in Python are a faithful representation of the set of integers \mathbb{Z}=\{\ldots,-2,-1,0,1,2,\ldots\}. Floating point numbers are approximate representations of the reals \mathbb{R}. A floating point number has 16 decimals of precision.

Special care is required when specifying rational numbers if you want to get exact answers. If you try to divide two numbers, Python will compute a floating point approximation:

>>> 1/7
0.14285714285714285           # a float

The floating point number 0.14285714285714285 is an approximation of the exact number \frac{1}{7} \in \mathbb{Q}. The float approximation has 16 decimals while the decimal expansion of \frac{1}{7} is infinitely long. To obtain an exact representation of \frac{1}{7} you need to create a SymPy expression. You can sympify any expression using the shortcut function S():

>>> S('1/7')                  # = sympify('1/7')
1/7                           # = Rational(1,7)

Note the input to S() is specified as a text string delimited by quotes. We could have achieved the same result using S(’1’)/7 since a SymPy object divided by an int is a SymPy object.

Except for the tricky Python division operator, other math operators like addition +, subtraction -, and multiplication * work as you would expect. The syntax ** is used to denote exponentiation:

>>> 2**10                    # same as S('2^10')
1024

When solving math problems, it’s best to work with SymPy objects, and wait to compute the numeric answer in the end. To obtain a numeric approximation of a SymPy object as a float, call its .evalf() method:

>>> pi
pi
>>> pi.evalf()               # = pi.n() = N(pi)
3.14159265358979

The method .n() is equivalent to .evalf(). The global SymPy function N() can also be used to to compute numerical values. You can easily change the number of digits of precision of the approximation. Enter pi.n(400) to obtain an approximation of \pi to 400 decimals.

Symbols

>>> from sympy import Symbol, symbols

Python is a civilized language so there’s no need to define variables before assigning values to them. When you write a = 3, you define a new name a and set it to the value 3. You can now use the name a in subsequent calculations.

Most interesting SymPy calculations require us to define symbols, which are the SymPy objects for representing variables and unknowns. For your convenience, when live.sympy.org starts, it runs the following commands automatically:

>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)

The first statement imports all the SymPy functions. The other three statements define some generic symbols x, y, z, and t, and several other symbols with special properties.

Note the difference between the following two statements:

>>> x + 2
x + 2                 # an Add expression
>>> p + 2
NameError: name 'p' is not defined

The name x is defined as a symbol, so SymPy knows that x + 2 is an expression; but the variable p is not defined, so SymPy doesn’t know what to make of p + 2. To use p in expressions, you must first define it as a symbol:

>>> p = Symbol('p')   # the same as p = symbols('p')
>>> p + 2
p + 2                 # = Add(Symbol('p'), Integer(2))

You can define a sequence of variables using the following notation:

>>> a0, a1, a2, a3 = symbols('a0:4')

You can use any name you want for a variable, but it’s best if you avoid the letters Q,C,O,S,I,N and E because they have special uses in SymPy: I is the unit imaginary number i\eqdef\sqrt{-1}, E is the base of the natural logarithm, S() is the sympify function, N() is used to obtain numeric approximations, and O is used for big-O notation.

Expressions

>>> from sympy import simplify, factor, expand, collect

You define SymPy expressions by combining symbols with basic math operations and other functions:

>>> expr = 2*x + 3*x - sin(x) - 3*x + 42
>>> simplify(expr)                   # simplify the expression
2*x - sin(x) + 42

The function simplify can be used on any expression to simplify it. The examples below illustrate other useful SymPy functions that correspond to common mathematical operations on expressions:

>>> factor( x**2-2*x-8 )             # factor a polynomial
(x - 4)*(x + 2)
>>> expand( (x-4)*(x+2) )            # expand and expression
x**2 - 2*x - 8
>>> collect(x**2+x*b+a*x+a*b, x)     # collect like terms in x
x**2 + (a+b)*x + a*b

To substitute a given value into an expression, call the .subs() method, passing in a python dictionary object { key:val, ... } with the symbol–value substitutions you want to make:

>>> expr  = sin(x) + cos(y)          # define an expression
>>> expr
sin(x) + cos(y)
>>> expr.subs({x:1, y:2})            # subs. x=1,y=1 in expr
sin(1) + cos(2)
>>> expr.subs({x:1, y:2}).n()        # compute numeric value
0.425324148260754

Note how we used .n() to obtain the expression’s numeric value.

Solving equations

>>> from sympy import solve

The function solve is the main workhorse in SymPy. This incredibly powerful function knows how to solve all kinds of equations. In fact solve can solve pretty much any equation! When high school students learn about this function, they get really angry—why did they spend five years of their life learning to solve various equations by hand, when all along there was this solve thing that could do all the math for them? Don’t worry, learning math is never a waste of time.

The function solve takes two arguments. Use solve(expr,var) to solve the equation expr==0 for the variable var. You can rewrite any equation in the form expr==0 by moving all the terms to one side of the equation; the solutions to A(x)=B(x) are the same as the solutions to A(x)-B(x)=0.

For example, to solve the quadratic equation x^2+2x-8=0, use

>>> solve( x**2 + 2*x - 8, x)
[2, -4]

In this case the equation has two solutions so solve returns a list. Check that x=2 and x=-4 satisfy the equation x^2+2x-8=0.

The best part about solve and SymPy is that you can obtain symbolic answers when solving equations. Instead of solving one specific quadratic equation, we can solve all possible equations of the form ax^2 + bx+c=0 using the following steps:

>>> a, b, c = symbols('a b c')
>>> solve( a*x**2 + b*x + c, x)
[(-b+sqrt(b**2 - 4*a*c))/(2*a), (-b-sqrt(b**2-4*a*c))/(2*a)]

In this case solve calculated the solution in terms of the symbols a, b, and c. You should be able to recognize the expressions in the solution—it’s the quadratic formula x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.

To solve a system of equations, you can feed solve with the list of equations as the first argument, and specify the list of unknowns you want to solve for as the second argument. For example, to solve for x and y in the system of equations x+y=3 and 3x-2y=0, use

>>> solve([x + y - 3, 3*x - 2*y], [x, y])
{x: 6/5, y: 9/5}

The function solve is like a Swiss Army knife you can use to solve all kind of problems. Suppose you want to complete the square in the expression x^2-4x+7, that is, you want to find constants h and k such that x^2-4x+7 = (x-h)^2 +k. There is no special “complete the square” function in SymPy, but you can call solve on the equation (x-h)^2 +k \; - \; (x^2-4x+7) = 0 to find the unknowns h and k:

>>> h, k = symbols('h k')
>>> solve( (x-h)**2 + k  - (x**2-4*x+7), [h,k] )
[(2, 3)]                               # so h = 2 and k = 3
>>> expand( (x-2)**2+3 )               # verify...
x**2 - 4*x + 7

Learn the basic SymPy commands and you’ll never need to suffer another tedious arithmetic calculation painstakingly performed by hand again!

Rational functions

>>> from sympy import together, apart

By default, SymPy will not combine or split rational expressions. You need to use together to symbolically calculate the addition of fractions:

>>> a, b, c, d = symbols('a b c d')
>>> a/b + c/d
a/b + c/d
>>> together(a/b + c/d)
(a*d + b*c)/(b*d)

Alternately, if you have a rational expression and want to divide the numerator by the denominator, use the apart function:

>>> apart( (x**2+x+4)/(x+2)  )
x - 1  +  6/(x + 2)

Exponentials and logarithms

Euler’s number e=2.71828\ldots is defined one of several ways,

and is denoted E in SymPy. Using exp(x) is equivalent to E**x.

The functions log and ln both compute the logarithm base e:

>>> log(E**3)    # same as ln(E**3)
3

By default, SymPy assumes the inputs to functions like exp and log are complex numbers, so it will not expand certain logarithmic expressions. However, indicating to SymPy that the inputs are positive real numbers will make the expansions work:

>>> x, y = symbols('x y')
>>> expand( log(x*y) )
log(x*y)
>>> a, b = symbols('a b', positive=True)
>>> expand( log(a*b) )
log(a) + log(b)

Polynomials

Let’s define a polynomial P with roots at x=1, x=2, and x=3:

>>> P = (x-1)*(x-2)*(x-3)
>>> P
(x - 1)*(x - 2)*(x - 3)

To see the expanded version of the polynomial, call its expand method:

>>> expand(P)
x**3 - 6*x**2 + 11*x - 6

When the polynomial is expressed in it’s expanded form P(x)=x^3-6^2 + 11x - 6, we can’t immediately identify its roots. This is why the factored form P(x)=(x-1)(x-2)(x-3) is preferable. To factor a polynomial, call its factor method or simplify it:

>>> factor(P)
(x - 1)*(x - 2)*(x - 3)
>>> simplify(P)
(x - 1)*(x - 2)*(x - 3)

Recall that the roots of the polynomial P(x) are defined as the solutions to the equation P(x)=0. We can use the solve function to find the roots of the polynomial:

>>> roots = solve(P,x)
>>> roots
[1, 2, 3]
# let's check if P equals (x-1)(x-2)(x-3)
>>> simplify( P  -  (x-roots[0])*(x-roots[1])*(x-roots[2]) )
0

Equality checking

In the last example, we used the simplify function on the difference of two expressions to check whether they were equal. This way of checking equality works because P=Q if and only if P-Q=0. To know whether P=Q, we can calculate simplify(P-Q) and see if the result equals . This is the best way to check whether two expressions are equal in SymPy because it attempts all possible simplifications when comparing the expressions. Below is a list of other ways to check whether two quantities are equal, with example cases where equality fails to be detected:

>>> P = (x-5)*(x+5)
>>> Q = x**2 - 25
>>> P == Q                                      # fail
False
>>> P - Q == 0                                  # fail
False
>>> simplify(P - Q)                             # works!
0
>>> sin(x)**2 + cos(x)**2  == 1                 # fail
False
>>> simplify( sin(x)**2 + cos(x)**2 - 1 )       # works!
0

Trigonometry

from sympy import sin, cos, tan, trigsimp, expand_trig

The trigonometric functions sin and cos take inputs in radians:

>>> sin(pi/6)
1/2
>>> cos(pi/6)
sqrt(3)/2

For angles in degrees, you need a conversion factor of \frac{\pi}{180}[rad/^\circ]:

>>> sin(30*pi/180)                 # 30 deg = pi/6 rads
1/2

The inverse trigonometric functions \sin^{-1}(x) = \arcsin(x) and \cos^{-1}(x) = \arccos(x) are used as follows:

>>> asin(1/2)
pi/6
>>> acos(sqrt(3)/2)
pi/6

Recall that \tan(x) = \frac{\sin(x)}{\cos(x)}. The inverse function of \tan(x) is \tan^{-1}(x) = \arctan(x)= atan(x)

>>> tan(pi/6)
1/sqrt(3)                          # = ( 1/2 )/( sqrt(3)/2 )
>>> atan( 1/sqrt(3) )
pi/6

The function acos returns angles in the range [0,\pi], while asin and atan return angles in the range [-\frac{\pi}{2},\frac{\pi}{2}].

Here are some trigonometric identities that SymPy knows:

>>> sin(x) == cos(x - pi/2)
True
>>> simplify( sin(x)*cos(y)+cos(x)*sin(y) )
sin(x + y)
>>> e = 2*sin(x)**2 + 2*cos(x)**2
>>> trigsimp(e)
2
>>> trigsimp(log(e))
log(2*sin(x)**2 + 2*cos(x)**2)
>>> trigsimp(log(e), deep=True)
log(2)

>>> simplify( sin(x)**4 - 2*cos(x)**2*sin(x)**2 + cos(x)**4 )
cos(4*x)/2 + 1/2

The function trigsimp does essentially the same job as simplify.

If instead of simplifying you want to expand a trig expression, you should use expand_trig, because the default expand won’t touch trig functions:

>>> expand(sin(2*x))
sin(2*x)
>>> expand_trig(sin(2*x))   # = expand(sin(2*x), trig=True)
2*sin(x)*cos(x)

Complex numbers

>>> from sympy import I, re, im, Abs, arg, conjugate

Consider the quadratic equation x^2=-1. There are no real solutions to this equation, but we can define an imaginary number i =\sqrt{-1} (denoted I in SymPy) that satisfies this equation:

>>> I*I
-1
>>> solve( x**2 + 1 , x)
[I, -I]

The solutions are x=i and x=-i, and indeed we can verify that i^2+1=0 and (-i)^2+1=0 since i^2=-1.

The complex numbers \mathbb{C} are defined as \{ a+bi \,|\, a,b \in \mathbb{R} \}. Complex numbers contain a real part and an imaginary part:

>>> z = 4 + 3*I
>>> z
4 + 3*I
>>> re(z)
4
>>> im(z)
3

The polar representation of a complex number is z\!=\!|z|\angle\theta\!= \!|z|e^{i\theta}. For a complex number z=a+bi, the quantity |z|=\sqrt{a^2+b^2} is known as the absolute value of z, and \theta is its phase or its argument:

>>> Abs(z)
5
>>> arg(z)
atan(3/4)

The complex conjugate of z=a+bi is the number \overline{z} = a-bi, which has the same absolute value as z but opposite phase:

>>> conjugate( z )
4 - 3*I

Complex conjugation is important for computing the absolute value of z (|z|=\sqrt{ z\overline{z} }) and for division by z (\frac{1}{z} = \frac{\overline{z}}{|z|^2}).

Euler’s formula

>>> from sympy import expand, rewrite

Euler’s formula shows an important relation between the exponential function e^x and the trigonometric functions \sin(x) and \cos(x):

To obtain this result in SymPy, you must specify that the number x is real and also tell expand that you’re interested in complex expansions:

>>> x = symbols('x', real=True)
>>> expand(exp(I*x), complex=True)
cos(x) + I*sin(x)
>>> re( exp(I*x) )
cos(x)
>>> im( exp(I*x) )
sin(x)

Basically, \cos(x) is the real part of e^{ix}, and \sin(x) is the imaginary part of e^{ix}. Whaaat? I know it’s weird, but weird things are bound to happen when you input imaginary numbers to functions.

Vectors

A vector \vec{v} \in \mathbb{R}^n is an n-tuple of real numbers. For example, consider a vector that has three components:

To specify the vector \vec{v}, we specify the values for its three components v_1, v_2, and v_3.

A matrix A \in \mathbb{R}^{m\times n} is a rectangular array of real numbers with m rows and n columns. A vector is a special type of matrix; you can think of the vector \vec{v} \in \mathbb{R}^n as a 1\times n matrix. Because of this equivalence between vectors and matrices, in SymPy we use Matrix objects to represent vectors.

This is how we define vectors and compute their properties:

>>> u = Matrix([4,5,6])
>>> u
[4, 5, 6]                 # 3-vector
>>> u[0]                  # 0-based indexing for entries
4
>>> u.norm()              # length of u
sqrt(77)
>>> uhat = u/u.norm()     # unit vector in same dir as u
>>> uhat
[4/sqrt(77), 5/sqrt(77), 6/sqrt(77)]
>>> uhat.norm()
1

Dot product

The dot product of the -vectors \vec{u} and \vec{v} can be defined two ways:

where \varphi is the angle between the vectors \vec{u} and \vec{v}. In SymPy,

>>> u = Matrix([ 4,5,6])
>>> v = Matrix([-1,1,2])
>>> u.dot(v)
13

We can combine the algebraic and geometric formulas for the dot product to obtain the cosine of the angle between the vectors

and use the acos function to find the angle measure:

>>> acos(u.dot(v)/(u.norm()*v.norm())).evalf()
0.921263115666387      # in radians  =  52.76 degrees

Just by looking at the coordinates of the vectors \vec{u} and \vec{v}, it’s difficult to determine their relative direction. Thanks to the dot product, however, we know the angle between the vectors is 52.76^\circ, which means they kind of point in the same direction. Vectors that are at an angle \varphi=90^\circ are called orthogonal, meaning at right angles with each other. The dot product between two vectors is negative when the angle between them is \varphi > 90^\circ.

The notion of the “angle between vectors” applies more generally to vectors with any number of dimensions. The dot product for n-dimensional vectors is \vec{u}\cdot\vec{v}=\sum_{i=1}^n u_iv_i. This means we can talk about “the angle between” 1000-dimensional vectors. That’s pretty crazy if you think about it—there is no way we could possibly “visualize” 1000-dimensional vectors, yet given two such vectors we can tell if they point mostly in the same direction, in perpendicular directions, or mostly in opposite directions.

The dot product is a commutative operation \vec{u}\cdot\vec{v} = \vec{v}\cdot\vec{u}:

>>> u.dot(v) == v.dot(u)
True

Cross product

The cross product, denoted \times, takes two vectors as inputs and produces a vector as output. The cross products of individual basis elements are defined as follows:

The cross product is defined by the following equation:

Here’s how to compute the cross product of two vectors:

>>> u = Matrix([ 4,5,6])
>>> v = Matrix([-1,1,2])
>>> u.cross(v)
[4, -14, 9]

The vector \vec{u}\times \vec{v} is orthogonal to both \vec{u} and \vec{v}. The norm of the cross product \|\vec{u}\times \vec{v}\| is proportional to the lengths of the vectors and the sine of the angle between them:

(u.cross(v).norm()/(u.norm()*v.norm())).n()
0.796366206088088    # = sin(0.921..)

The cross product is anticommutative, \vec{u}\times\vec{v} = -\vec{v}\times\vec{u}:

>>> u.cross(v)
[4, -14, 9]
>>> v.cross(u)
[-4, 14,-9]

Watch out for this, because it’s a new thing. The product of two numbers a and b is commutative: ab = ba. The dot product of two vectors \vec{u} and \vec{v} is commutative: \vec{u}\cdot\vec{v} = \vec{v}\cdot\vec{u}. However the cross product is not commutative: \vec{u}\times\vec{v} \neq \vec{v}\times\vec{u}, it is anticommutative: \vec{u}\times\vec{v} = -\vec{v}\times\vec{u}.

Conclusion

I’ll conclude with some words of warning about technological dependence. Computer technology is very powerful and everywhere around us, but we must not forget that computers are merely calculators that depend on human commands to direct them. This means it’s important for you to learn how to do math “by hand” first, in order to know how to instruct computers to do the math for you.

I don’t want you to use the tricks you learned in this tutorial to avoid learning how to do math and blindly rely on SymPy to do math calculations for you. That’s not a good idea! I’ll be very disappointed if you use SymPy to skip the “intellectual suffering” necessary to learn the new math concepts like numbers, equations, functions, etc. That’s what math is all about—understand math concepts and the relationships between concepts. The part that is about rote memorized of math calculations procedures that you should have learned at school is not important at all. The tedious and repetitive math calculations is precisely what can be “outsourced” to SymPy.

To solve problems in math (or physics, chemistry, biology, etc.) the most important things are to: A) define the variables relevant for the problem, B) draw a diagram, and C) clearly set up the problem’s equations in terms of the variables you defined. With these steps in place, half the work of solving the problem is already done! Computers can’t help with these important, initial modelling and problem-specific tasks—only humans are good at this stuff. Once you set up the problem (A, B, C), SymPy can help you breeze through any subsequent calculations that might be necessary to obtain the final answer.

Most of the big math and science discoveries were made using pen and paper, which shows that scribbling on paper is a useful as a tool for thinking. With what you learned about SymPy, you now have access to the combination of pencil and paper for thinking and SymPy for calculating. It’s a very powerful combination! What is a real-world problem you’d like to solve? Try modelling the problem using math equations and see what happens. Go out there and do some science!

Links

[ Installation instructions for jupyter notebook ]

https://jupyter.readthedocs.io/en/latest/install.html

[ The official SymPy tutorial ]

http://docs.sympy.org/latest/tutorial/intro.html

[ A list of SymPy gotchas ]

http://docs.sympy.org/dev/gotchas.html

No Bullshit Guide textbook series

This book is part of the No Bullshit Guide series of textbooks. These textbooks make the most important and useful science topics accessible to a general audience.

No Bullshit Guide to Math & Physics

Newton’s laws of physics form the best-known example of the scientific approach for understanding the physical world. Starting with a few basic principles, we can build accurate models for the motion of objects and the forces that exist between them. Calculus is the language of quantitative science. Many of the fundamental laws of physics, chemistry, biology, and economics are expressed in the language of calculus. A solid grasp of this subject is essential for anyone who wants to pursue studies in science, engineering, or business. This book combines math, mechanics, and calculus topics into a single tome. By learning calculus and mechanics at the same time, readers are able to better see the connections between the two subjects, and understand concepts on a deeper level. This combined, all-in-one book is ideal for adults who want to learn (or relearn) university-level math and physics topics.

[BOOK] Ivan Savov. No Bullshit Guide to Math & Physics, Minireference Publishing, Fifth edition, 2014, 978-0-9920010-0-1.

No Bullshit Guide to Linear Algebra

Linear algebra is the study of vectors and linear transformations. You need to know linear algebra to understand computer graphics, statistics, machine learning, quantum mechanics, and many other areas of science, business, and technology. This book offers a comprehensive guide to all aspects of linear algebra: computational, geometric, and theoretical. A sizeable part of the book is dedicated to the applications of linear algebra, including a chapter on quantum mechanics. This book will be of interest to undergraduate students taking a linear algebra course, graduate students who need a linear algebra review, programmers, data scientists, and anyone who’s interested in quantum mechanics.

[BOOK] Ivan Savov. No Bullshit Guide to Linear Algebra, Minireference Publishing, Second edition, 2017, ISBN 978-0-9920010-2-5.

Visit  minireference.com to learn more about these and other titles.