Integrate[x^2,x]

Integrate[x^2,{x,-1,5}]

f[x_]:=Exp[Cos[x]]

a:=0

b:=2*Pi

n:=100

You can use Greek letters in Mathematica. Try this by entering a backslash (\) followed by [CapitalDelta]

Δx:=(b-a)/n

Here’s a command to use the Midpoint rule for n rectangles (in this case, we’ve chosen n to be 10).

Sum[f[(a+(i-1)*Δx+a+i*Δx)/2]*Δx,{i,1,n}]

N[%]

Here’s the left and right endpoint approximations.

Sum[f[a+(i-1)*Δx]*Δx,{i,1,n}]

N[%]

Sum[f[a+i*Δx]*Δx,{i,1,n}]

N[%]

Here’s a command that invokes the Trapezoidal Rule

Δx/2*(f[a]+f[b]+2*Sum[f[a+i*Δx],{i,1,n-1}])

N[%]

Finally, here’s a command that invokes Simpson’s Rule

Δx/3*(f[a]+f[b]+4*Sum[f[a+(2*i+1)*Δx],{i,0,(n-2)/2}]+2*Sum[f[a+2*i*Δx],{i,1,(n-2)/2}])

N[%]

Plot[Abs[f''[x]],{x,a,b}]

Plot[Abs[f''''[x]],{x,a,b}]

Reduce[12*(2*Pi)^5/(180*q^4)<0.0001,q]