MTH 229 Projects


This is a collection of notes for exploring calculus concepts with the Julia programming language, as is done with MTH229 at the College of Staten Island.

These notes are broken into different sections, where most all sections have some self-grading questions at the end that allow you to test your knowledge of that material. The code should be copy-and-pasteable into a julia session. The code output is similar to what would be shown if evaluated in an IJulia cell, our recommended interface while learning julia.

The notes mostly follow topics of a standard first-semester calculus course after some background material is presented for learning julia within a mathematical framework.

The MTH229 package

The notes assume that the MTH229 add-on package is installed. In the lab this will be the case. If using juliabox then it must be done (once). The process involves:

(For other Julia installations the command Pkg.clone("") should work.)

The projects

Accompanying each set of notes is a "project" that is to be completed in the lab time. For the lab machines these are pre-loaded.

For juliabox usage, the projects may be copied in all at once. This is completed by:

other two text boxes.)

If all goes to plan, a "folder" titled "229-projects" will contain the projects for your usage.

Otherwise, each project individually comes as an "ipynb" file. These can be downloaded from this page, and then "uploaded" into juliabox using the "upload" button of the file manager.

The projects for MTH 229

See all projects at

Basics of types, order of operations, assignment and variables.

An assignment for this material: ipynb view

Shows how to define and call a function. Technical parts include ternary operator, multiple arguments, and return values (tuples).

An assignment for this material: ipynb view

This demonstrates the use of the Plots package for plotting. This package provides a very simple plot interface for graphing one or more functions.

As well, a discussion about arrays and mapping a function over an array is given. This will be useful later on with limits, ...

An assignment for this material: ipynb view

Finding zeros for polynomials, graphically finding zeros, and using the bisection method.

The add-on Roots package provides some convenient functionality.

An assignment for this material: ipynb view

Basics of limits.

Discussion on floating point representation and potential issues (subtracting like-sized objects!)

An assignment for this material: ipynb view

Explore forward difference and central difference with a bit on error analysis.

We end with a brief discussion on automatic differentiation, as implemented in the ForwardDiff add-on package.

An assignment for this material: ipynb view

A look at the relationship between a function and its first and second derivatives.

An assignment for this material: ipynb view

Basics of Newton's method with a copy-and-paste function to do the work after the student explores a bit.

Discusses iterative algorithms, approximation, some analysis.

The fzero function of the Roots package is discussed.

An assignment for this material: ipynb view

A project on minimization and maximization. Some standard applied problems are presented.

An assignment for this material: ipynb view

Basics of integration with applications including rectangle, trapezoid, Simpson's, and the quaggk function. Applications to volumes of solids of revolution.

An assignment for this material: ipynb view

Calculus II material

See the projects at

Discusses how to do some symbolic math in julia through the SymPy package.

An assignment for this material: ipynb view

An assignment for this material: ipynb view

An assignment for this material: ipynb view

An assignment for this material: ipynb view

An assignment for this material: ipynb view

Calculus III material

Read some notes on this material: ipynb view

An assignment for this material: ipynb view

Read some notes on this material: ipynb view

An assignment for this material: ipynb view

Read some notes on this material: ipynb view

An assignment for this material: ipynb view

Basic ideas

Julia makes an excellent choice for this material as its syntax is very similar to standard mathematical syntax. The ability to define mathematical functions using the familiar f(x) = ... notation makes getting started really easy. Further, the fact that functions are first-class objects means that it is possible to create higher-order julia functions that mirror the standard operators of calculus. The following pattern is used throughout:

action(function_object, args...)

For example, the notes use:

With just this basic set of actions, akin to buttons on the calculator, a rich variety of problems can be addressed.

Some additional resources

Julia is a young language, with the bulk of its development being done since its initial announcement. It has relatively few online resources. Some are compiled here. Many of these are linked to from a julia web brain.

Before starting out with Julia it must be available.

We recommend taking advantage of the free web service at, but Julia can be easily installed on a local computer, as described in the following.

Downloading julia

In order to get started with Julia it needs to be installed. If this is not done already, you have a bit of work to do to get julia and the notebook interface provided by IJulia.

First to install julia you can download a copy or install it from source. Likely a download is easiest. Official releases are available from Download the latest released version. Installation is hopefully similar to what you do for other software on your system.

Starting julia

Starting julia varies amongst the different operating systems. All have a console where commands are typed for julia to interpret and execute. This is known as the command line and though a long familiar means of interacting with computers, it is generally not familiar to the average student. We will need to learn to like the command line. Once done, you may think it is great, but it can a bit frustrating getting to that attitude.

Here is what the command line looks like on startup from a mac book pro within the terminal:

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation:
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official release
|__/                   |  x86_64-apple-darwin14.5.0

The command line is the last line: a prompt beginning with julia>. Here is where you type an expression and then the enter key to ask julia to evaluate it.

A simple command is then typed into the computer followed by the enter key. This is then sent to julia's interpreter and an answer returned:

2 + 2

If you get 4, you are able to use julia.

Installing MTH229

One command that the notes assume you have typed is the one to install the add-on MTH229 package. If you haven't done so, try this:


This may take a while to complete.

IJulia An enhanced interface for using julia interactively

The command line is not the most comfortable learning experience for julia, rather it is suggested that the IJulia notebook interface be used. In the IJulia notebook, the command line is replaced by a cell where commands can be entered and executed in batches. The editing of commands is much easier and some features for integrated help are available.

The above graphic is from the main web page for julia ( and shows the IJulia notebook with some graphics provided by the Gadfly package.

Using IJulia will require one more additional installation step:


Afterwards those commands are successful, the following command will start the notebook interface:

using IJulia

Extending Julia with packages

Julia can be extended through external packages. Although a relatively young language, there are already around 1000 add-on packages readily available for Julia through its package manager.

For example, the MTH229 package installs the Plots package for making plots, the Roots package for finding zeros of functions and the SymPy package for symbolic math within Julia.

Installing an add-on pacakge

In the julia world, a package author may publish his or her package so that it is easy for an end user to use and install. For the end user there are just a handful of important commands to install a package:

Using a package

External packages must be loaded into a session. This need only be done once. The easiest way is to use the keyword using, a in using Plots. This must be done before you try to use any functionality related to the package. For interactive use, it is a good idea to just pull in familiar packages at the outset.

This has some cost, as some packages are slow to load.

So, to make a plot using Plots, the sequence might go like:

using Plots
f(x) = x^2 - 2x
plot(f, -2, 1)			

(The command using MTH229 will load the Plots package for you.)

The manual has some more information.