# Need help with integrals and derivatives

3 views (last 30 days)
Chris on 20 Jun 2013
The length of a parameterized curve is the integral of the norm of the derivatives of the parameterized equations. So the curve length from time t1 to t2 is obtained by
s=integral(sqrt(x^2+y^2+z^2))from t1 to t2
Consider the curve parameterized by the equations
x(t)=sin(t)+t^2
y(t)=2t+cos(t)
z(t)=t
Write a program to determine
a) Length of this curve from t = 0 to t =3*pi.
b) Draw three dimensional plot of this curve.
c) Derivative of each component using the diff command
Please help I know I am going to have to use the trapz command but I am unsure how to do all three. It keeps telling me that t is undefined and I am not sure how to work it. Some help would be greatly appreciated.

Roger Stafford on 20 Jun 2013
You should not be using 'trapz' in this problem in which you can calculate, (using some standard calculus or matlab's symbolic toolbox,) the integrand as an explicit function of t. The 'trapz' function is really intended for inherently discrete data such as that from empirical observations. Instead use one of the quadrature functions such as 'integral' or 'quad' to do your numerical integration. It is likely your teacher will expect you to do it this way for this problem.
For a) what you want to find is the integral with respect to t over the given t-range of the square root of the sum of the squares of the three derivatives, and this integrand can be obtained as a function of t for which you can give an explicit formula.

Walter Roberson on 20 Jun 2013
x = @(t) sin(t) + t.^2;
Then try
x([0 1/4 1/3 1/2 1])
Chris on 20 Jun 2013
Ok that's helps me with the first two but I am lost on derivatives. Could you explain how those work and how I can format it to this situation?