% exam 2
% problem 5

clear all; clc; close all

syms t real
x = sym('x(t)');
x0=2; % m
vx0=1; % m/s
% y = 0.5*x(t)^2
y = 0.5*x^2
vy = diff(y, t)
list={diff(x,t),x};
nlist={1, 2};
vy0 = subs(vy, list, nlist)

% vy = 2
 
y =
 
1/2*x(t)^2
 
 
 
vy =
 
x(t)*diff(x(t),t)
 
 
 
vy0 =
 
2