using System; using System.Collections.Generic; using System.Linq; using System.Text; using V = Science.Mathematics.VectorCalculus; namespace VectorCalculus5Ed.Chapter2.Section3 { public class Example03 { public Example03() { } private string result; public string Result { get{return result;} } public void Compute() { Science.Mathematics.Function.ToLastType f = new Science.Mathematics.Function.ToLastType(func); double[] x = new Double[2]; x[0] = 1.0; x[1] = 6.0; V.PartialDerivative obj = new V.PartialDerivative(f, x); obj.WithRespectTo = 0; obj.Compute(); result += obj.Result.ToString() + "\r\n"; result += (x[1] * x[1] * x[1] / Math.Sqrt(x[0] * x[0] + x[1] * x[1]) / Math.Sqrt(x[0] * x[0] + x[1] * x[1]) / Math.Sqrt(x[0] * x[0] + x[1] * x[1])).ToString() + "\r\n"; } private double func(double[] x) { return x[0] * x[1]/Math.Sqrt(x[0]*x[0]+x[1]*x[1]); } } } /* 0.959734628593539 0.959734628593437 */