Teach with Live Scripts

The following is an example of how to use live scripts in the classroom. This example shows how to:

Add equations to explain the underlying mathematics.

Execute individual sections of MATLAB code.

Include plots for visualization.

Use links and images to provide supporting information.

Experiment with MATLAB code interactively.

Reinforce concepts with other examples.

Use live scripts for assignments.

What does it mean to find the nth root of 1?

Add equations to explain the underlying mathematics for concepts that you want to teach. To add an equation, go to the Live Editor tab and click the Equation button. Then, select from the symbols and structures in the Equation tab.

Today we're going to talk about finding the roots of 1. What does it mean to find the nth root of 1? The nth roots of 1 are the solutions to the equation .

For square roots, this is easy. The values are . For higher-order roots, it gets a bit more difficult. To find the cube roots of 1 we need to solve the equation . We can factor this equation to get

So the first cube root is 1. Now we can use the quadratic formula to get the second and third cube roots.

Calculate the Cube Roots

To execute individual sections of MATLAB code, go to the Live Editor tab and click the Run Section button. Output appears together with the code that created it. Create sections using the Section Break button.

In our case a, b, and c are all equal to 1. The other two roots are calculated from these formulas:

Finding Higher Order Roots

To add supporting information, go to the Live Editor tab and click the Hyperlink and Image buttons. Students can use supporting information to explore lecture topics outside of the classroom.

Once you get past , things get even trickier. For 4th roots we could use the quartic formula discovered by Lodovico Ferrari in 1540. But this formula is long and unwieldy, and doesn't help us find roots higher than 4. Luckily, there is a better way, thanks to a 17th century French mathematician named Abraham de Moivre.

He is best known for de Moivre's theorem that links complex numbers and trigonometry, and for his work on the normal distribution and probability theory. De Moivre wrote a book on probability theory, The Doctrine of Chances, said to have been prized by gamblers. De Moivre first discovered Binet's formula, the closed-form expression for Fibonacci numbers linking the nth power of the golden ratio φ to the nth Fibonacci number. He was also the first to postulate the Central Limit Theorem, a cornerstone of probability theory.

de Moivre's theorem states that for any real x and any integer n,

How does that help us solve our problem? We also know that for any integer k,

So by de Moivre's theorem we get

Calculating the nth Roots of 1

Use the Live Editor to experiment with MATLAB code interactively. Show students how important parameters affect the analysis.

We can use this last equation to find the nth roots of 1. For example, for any value of n, we can use the formula above with values of . We can use this MATLAB code to experiment with different values of n:

Finding the nth roots of -1, i, and -i

Use additional examples to reinforce important concepts. Modify code during the lecture to answer questions or explore ideas in more depth.

We can find the roots of -1, i, and -i just by using extensions of the approach described above. If we look at the unit circle we see that the values of 1, i, -1, -i appear at angles , , , and respectively.