Photo by Antoine Dautry

Consider the curve given by the equation y^3 - xy = 2

Evaluate Velocity(\frac{dy}{dx}), Acceleration(\frac{d^2 y}{dx^2}) and write python functions

1. Velocity

\frac{d}{dx}[y^3-xy] = \frac{d}{dx}[2]

\frac{dy}{dx}3y^2 -(y+x \frac{dy}{dx}) = 0

\frac{dy}{dx}3y^2 - x \frac{dy}{dx} = y

\frac{dy}{dx}(3y^2 - x) = y

\frac{dy}{dx} = \frac{y}{3y^2-x}

def velocity(x, y):

    if x >= 3:
        print(“error out of valid domain”)
    return y/(3**2 – x)

2. Acceleration

\frac{d^2 y}{dx^2} = \frac{d}{dx}[\frac{y}{3y^2-x}]

\frac{\frac{dy}{dx}(3y^2-x)-y(6y\frac{dy}{dx} - 1)}{(3y^2-x)^2}

\frac{\frac{y}{3y^2-x}(3y^2-x)-y(6y\frac{y}{3y^2-x}-1)}{(3y^2-x)^2}

def acceleration(x, y):

   if x >= 3:
       print(“error out of domain”)
   return((y/3*y**2 -x) – y*((6*y*y/(3*y**2-x))-1))/(3*y**2-x)**2