Math in
motion.

Turn an equation into a surface you can rotate. Build a square wave from sine waves. Write a script that sets a pendulum swinging. Explore it all on iPhone, iPad, and Mac.

Plot3D(2cos(x)*sin(y))Drag to rotate
The purple mesh of the cosine–sine wave surface
Wave surfaceFunction surface

What can you do with MathStudio?

Build a calculation one entry at a time. Start with an expression, see its exact answer, then use the same notebook to graph a function, fit a model, or write a script.

  • Fourier analysis

    Build a periodic signal from sine waves. The orange line shows the square wave and the red line shows its Fourier approximation.

    As you add higher harmonics, the flat stretches sharpen and the ripples crowd closer to each jump.

    MathStudio code
    Slider(n,1,30,1,6)
    Plot(SquareWave(x),color=orange)
    Plot(FourierSeries([[-1,-@pi..0],[1,0..@pi]],x,n),color=red)
    Explore Fourier analysis
  • Light polarization

    Split a light wave into two perpendicular components. The cyan and yellow curves show how each component varies along the direction of travel.

    The magenta curve traces the tip of the electric field at one position. Try 0° for a straight line and 90° for an ellipse.

    MathStudio code
    Slider(d, 0, 360, 5, 45)
    a = d*@pi/180
    ParametricPlot3D(2*cos(u), u, 0, u=[0,4@pi,200], color=cyan)
    ParametricPlot3D(0, u, 2.5*cos(u+a), u=[0,4@pi,200], color=yellow)
    ParametricPlot3D(2*cos(u), 0, 2.5*cos(u+a), u=[0,2@pi,200], color=magenta)
    for i in 0..80
      s = 4@pi*i/80
      ParametricPlot3D(u*2*cos(s), s, 0, u=[0,1,2], color=cyan)
      ParametricPlot3D(0, s, u*2.5*cos(s+a), u=[0,1,2], color=yellow)
    end
    Plot3D(axis=0, background=black)
    Read the optics script
  • Newton’s cradle

    Lift the first of five suspended balls and let it swing. When it reaches the row, the ball at the far end swings out.

    The script uses the string length and release angle to calculate each swing and draws the frame, strings, and balls with parametric plots.

    MathStudio code
    numerical
    Slider(A, 5, 60, 1, 45)
    z0 = A*@pi/180 // Release angle in radians
    l = 9.7 // String length in centimeters
    r = 1.3 // Ball radius in centimeters
    
    d1 = 9 // Bottom horizontal bars length
    d2 = 9 // Vertical bars length
    d3 = 11 // Upper horizontal bars length
    R = 0.3 // Radius of the structure
    p = asin(((d1+2)/2)/l) // Angle between strings and zy-plane
    a = (1+R*cos(v))*cos(u)
    b = (1+R*cos(v))*sin(u)
    c = R*sin(v)
    d = R*sin(u)
    e = R*cos(u)
    // Structure
    ParametricPlot3D(a-d1/2, c-1-d3/2, b+1+R, v=[0, 2@pi], u=[@pi, 3*@pi/2], lines=0, color=gray)
    ParametricPlot3D(v-d1/2, e-1-d3/2, d+R, u=[0, 2@pi, 30], v=[0, d1], lines=0, color=gray)
    ParametricPlot3D(-a+d1/2, c-1-d3/2, b+1+R, v=[0, 2@pi], u=[@pi, 3*@pi/2], lines=0, color=gray)
    ParametricPlot3D(d+1+d1/2, e-1-d3/2, v+1+R, u=[0, 2@pi, 30], v=[0, d2], lines=0, color=gray)
    ParametricPlot3D(c+1+d1/2, a-d3/2, b+d2+1+R, v=[0, 2@pi], u=[@pi/2, @pi], lines=0, color=gray)
    ParametricPlot3D(e+1+d1/2, v-d3/2, d+d2+2+R, u=[0, 2@pi, 30], v=[0, d3], lines=0, color=gray)
    ParametricPlot3D(c+1+d1/2, -a+d3/2, b+d2+1+R, v=[0, 2@pi], u=[@pi/2, @pi], lines=0, color=gray)
    ParametricPlot3D(d+1+d1/2, e+d3/2+1, v+1+R, u=[0, 2@pi, 30], v=[0, d2], lines=0, color=gray)
    ParametricPlot3D(-a+d1/2, c+1+d3/2, b+1+R, v=[0, 2@pi], u=[@pi, 3*@pi/2], lines=0, color=gray)
    ParametricPlot3D(v-d1/2, e+1+d3/2, d+R, u=[0, 2@pi, 30], v=[0, d1], lines=0, color=gray)
    ParametricPlot3D(a-d1/2, c+1+d3/2, b+1+R, v=[0, 2@pi], u=[@pi, 3*@pi/2], lines=0, color=gray)
    ParametricPlot3D(d-1-d1/2, e+1+d3/2, v+1+R, u=[0, 2@pi, 30], v=[0, d2], lines=0, color=gray)
    ParametricPlot3D(c-1-d1/2, -a+d3/2, b+d2+1+R, v=[0, 2@pi], u=[@pi/2, @pi], lines=0, color=gray)
    ParametricPlot3D(e-1-d1/2, v-d3/2, d+d2+2+R, u=[0, 2@pi, 30], v=[0, d3], lines=0, color=gray)
    ParametricPlot3D(c-1-d1/2, a-d3/2, b+d2+1+R, v=[0, 2@pi], u=[@pi/2, @pi], lines=0, color=gray)
    ParametricPlot3D(d-1-d1/2, e-1-d3/2, v+1+R, u=[0, 2@pi, 30], v=[0, d2], lines=0, color=gray)
    // Balls and ropes static
    ParametricPlot3D(sin(p)*u, -2*r, d2+2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(-sin(p)*u, -2*r, d2+2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(sin(p)*u, 0, d2+2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(-sin(p)*u, 0, d2+2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(sin(p)*u, 2*r, d2+2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(-sin(p)*u, 2*r, d2+2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(r*sin(u)*cos(v), -2*r+r*cos(u)cos(v), d2+2+r*sin(v)-l*cos(p), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    ParametricPlot3D(r*sin(u)*cos(v), r*cos(u)cos(v), d2+2+r*sin(v)-l*cos(p), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    ParametricPlot3D(r*sin(u)*cos(v), 2*r+r*cos(u)cos(v), d2+2+r*sin(v)-l*cos(p), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    // Balls and ropes on motion
    Animate(t, 0..100 -> 0.03)
    z = (z0+z0^3/192+z0^5*23/61440)*cos(1/4*sqrt(9.80665/(l/100))*(1+sqrt(cos(z0/2)))^2*t)-(z0^3/192+z0^5*23/61440)*cos(3*1/4*sqrt(9.80665/(l/100))*(1+sqrt(cos(z0/2)))^2*t) // Angle motion approximate solution
    if sin(z) > 0
    ParametricPlot3D(-(2+d1)/2*u, -4*r-l*sin(z)*cos(p)+(l*sin(z)*cos(p))*u, 2+d2-l*cos(z)*cos(p)+(l*cos(z)*cos(p))*u, u=[0, 1], color=brown)
    ParametricPlot3D((2+d1)/2*u, -4*r-l*sin(z)*cos(p)+(l*sin(z)*cos(p))*u, 2+d2-l*cos(z)*cos(p)+(l*cos(z)*cos(p))*u, u=[0, 1], color=brown)
    ParametricPlot3D(r*sin(u)*cos(v), -4*r-l*sin(z)*cos(p)+r*cos(u)cos(v), 2+d2-l*cos(z)*cos(p)+r*sin(v), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    ParametricPlot3D(sin(p)*u, 4*r, 2+d2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(-sin(p)*u, 4*r, 2+d2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(r*sin(u)*cos(v), 4*r+r*cos(u)cos(v), 2+d2+r*sin(v)-l*cos(p), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    else
    ParametricPlot3D(-(2+d1)/2*u, 4*r-l*sin(z)*cos(p)+(l*sin(z)*cos(p))*u, 2+d2-l*cos(z)*cos(p)+(l*cos(z)*cos(p))*u, u=[0, 1], color=brown)
    ParametricPlot3D((2+d1)/2*u, 4*r-l*sin(z)*cos(p)+(l*sin(z)*cos(p))*u, 2+d2-l*cos(z)*cos(p)+(l*cos(z)*cos(p))*u, u=[0, 1], color=brown)
    ParametricPlot3D(r*sin(u)*cos(v), 4*r-l*sin(z)*cos(p)+r*cos(u)cos(v), 2+d2-l*cos(z)*cos(p)+r*sin(v), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    ParametricPlot3D(sin(p)*u, -4*r, 2+d2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(-sin(p)*u, -4*r, 2+d2-l*cos(p)+cos(p)*u, u=[0, l], color=brown)
    ParametricPlot3D(r*sin(u)*cos(v), -4*r+r*cos(u)cos(v), 2+d2+r*sin(v)-l*cos(p), u=[0, 2@pi, 30], v=[0, 2@pi, 30], lines=0, color=red)
    end
    Plot3D(width=800, height=500, axis=0)
    Read the original mechanics script
  • Algebra & calculus

    MathStudio’s computer algebra system typesets exact answers. Factor a polynomial, differentiate a product, or find an integral. Each result appears directly below the expression you entered.

    At each point on the parabola, the derivative gives the slope of the orange tangent line.

    MathStudio code
    Slider(a, -2, 2, 0.1, 1)
    m = Eval(D(x^2, x), x, a)
    Plot(x^2, color=blue)
    Plot(a^2+m*(x-a), color=orange)
    ListPlot([a], [a^2], color=magenta)
    Explore calculus
  • Basic calculations

    From basic calculations to college calculus, MathStudio gives you hundreds of scientific functions. Keep a square root in exact form, evaluate a factorial, or switch to a decimal approximation.

    A factorial counts the ways to arrange distinct objects. Set n to 6 to see why six objects have 720 possible orders.

    MathStudio code
    Slider(n, 0, 10, 1, 6)
    n!
    See basic expressions
  • 2D graphing

    Plot several functions on the same axes to see where they agree and where they diverge. Trace a curve, draw a vector field, or compare a periodic signal with its Fourier approximation.

    One coordinate completes seven oscillations while the other completes eight. Together they trace a closed Lissajous curve.

    MathStudio code
    Slider(p, 0, 100, 1, 65)
    t = 2@pi*p/100
    if p > 0
      ParametricPlot(sin(7u), sin(8u), u=[0,t,600], color=green)
    end
    ListPlot([sin(7t)], [sin(8t)], color=magenta)
    Explore 2D graphing
  • 3D graphing

    Plot a function of two variables or define a surface with parametric equations. Drag to rotate the graph and inspect its peaks, valleys, and folds from a different angle.

    This surface depends only on distance from the origin. Look from above to see concentric rings, then turn it sideways to see the cosine profile.

    MathStudio code
    r = sqrt(x^2+y^2)
    Plot3D(cos(r), x=[-8,8], y=[-8,8])
    Explore 3D graphing
  • Regression analysis

    Plot lists of data with built-in regression analysis. Give MathStudio your measured x and y values to draw a scatter plot and fit a line. Compare it with a quadratic or exponential model when the data curve.

    Eight measurements stay fixed. Changing the ninth shows how much a single observation can tilt the fitted line.

    MathStudio code
    Slider(h, 1, 12, 0.1, 6)
    xs = [1,4,9,5,7,5,4,2,9]
    ys = [3,4,5,7,8,10,4,7,h]
    ListPlot(xs, ys, regression=linear, color=blue)
    ListPlot([9], [h], color=magenta)
    Compare regression models
  • Scripting

    Develop your ideas with MathStudio’s expressive scripting language. Use variables, loops, and conditionals to turn a calculation into a program you can run again.

    Follow a loop that adds the integers from 1 to 10. Each press includes one more number in the sum.

    MathStudio code
    Button(n, 0:10, 0)
    total = 0
    for k in 1..10
      if k <= n
        total += k
      end
    end
    total
    Explore scripting
  • Variable controls

    Create controls to interactively change the values of variables in plots and expressions. A slider lets you adjust a parameter and see its effect without editing the equation.

    View the electric field end-on. With no phase difference the field traces a line. At a quarter turn it traces an ellipse.

    MathStudio code
    Slider(d, 0, 360, 1.8, 45)
    a = d*@pi/180
    ParametricPlot(2cos(u), 2.5cos(u+a), u=[0,2@pi,240], color=magenta)
    ParametricPlot(2u, 2.5u*cos(a), u=[0,1], color=blue)
    ListPlot([2], [2.5cos(a)], color=blue)
    Explore variable controls
  • Units

    From unit conversions to compound unit arithmetic, MathStudio keeps track of units as you calculate. Add feet to inches, convert Fahrenheit to Celsius, or multiply speed by time to find distance.

    Temperature scales have different zero points. Try −40 °C to find a temperature where the two readings agree.

    MathStudio code
    Slider(c, -40, 100, 1, 40)
    (c*@C) -> @F
    Explore units and conversions
Documentation

The MathStudio reference

Look up a function, follow the manual, or open a shared script.

Browse the reference