Double (Standing For Double-Precision Number) : Quadl ( )
Double (Standing For Double-Precision Number) : Quadl ( )
Double (Standing For Double-Precision Number) : Quadl ( )
is obtained with a = [3 6 9]; b = [1 2 0]; k = polyder(a,b) k = 12 36 42 18 This result represents the polynomial
[q,d] = polyder(b,a) returns the numerator q and denominator d of the derivative of the polynomial
quotient b/a Create the anonymous function f(x) = e-x (ln x)2.
2
q = integral(fun,0,Inf) q = 1.9475
integral
Numerically evaluate integral
Syntax
q = integral(fun,xmin,xmax) approximates the integral of function fun from xmin to xmax using global adaptive quadrature and default error tolerances.
example
q = integral(fun,xmin,xmax,Name,Value) specifies additional options with one or more Name,Value pair arguments.
Examples
collapse all
q = integral(fun,0,Inf) q = 1.9475
Integrate Parameterized Function
Create the anonymous function f(x) = 1/(x3 2x c) with one parameter, c.
q = integral(@(x)fun(x,5),0,2) q = -0.4605
Evaluate Integral with Singularity at the Lower Limit of Integration
Create the anonymous function f(x) = ln(x).
fun = @(x)log(x);
Evaluate the integral from x=0 to x=1 with the default error tolerances.
q2 = integral(fun,0,1,'RelTol',0,'AbsTol',1e-12) q2 = -1.000000000000010
Complex Contour Integration Using Waypoints
Specify waypoints [1+1i,1-1i] to integrate over the triangular path: 0 to 1+1i to 1-1i to 0. Create the anonymous function f(z) = 1/(2z 1).
q = integral(fun,0,0,'Waypoints',[1+1i,1-1i]) q = 0 - 3.1416i
Integrate Vector-Valued Function
Specify 'ArrayValued',true to evaluate the integral of an array-valued or vector-valued function. Create the anonymous vector-valued function f(x) = [sin x, sin 2x, sin 3x, sin 4x, sin 5x] and integrate from x=0 to x=1.
fun = @(x)x.^5.*exp(-x).*sin(x);
Evaluate the integral from x=0 to x=Inf , adjusting the absolute and relative tolerances.
integral2
Numerically evaluate double integral
Syntax
= integral2(fun,xmin,xmax,ymin,ymax) approximates the integral of the function z = fun(x,y) over the planar region xmin x xmax and ymin(x) y ymax(x).
q
example
Examples
collapse all
is undefined when x and y are zero. boundary. Create the anonymous function.
q = integral2(polarfun,0,pi/2,0,rmax) q = 0.2854
Evaluate Double Integral of Parameterized Function with Specific Method and Error Tolerance
Create the anonymous parameterized function f(x,y) = ax2 + by2 with parameters a=3 and b=5.