Function Centroid

Author

Eric W. Weisstein
April 14, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Calculus/FunctionCentroid.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/FunctionCentroid.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

FunctionCentroid[f_,{x_,xmin_,xmax_},opts___]:=Integrate[f x,{x,xmin,xmax},opts]/Integrate[f,{x,xmin,xmax},opts]

FunctionCentroid[f_,x_,opts___]:=FunctionCentroid[f,{x,-Infinity,Infinity},opts]

Example

Integrate[Exp[-(x-x0)^2/(2σ^2)] x,{x,-∞,∞},Assumptions->σ>0]

Integrate[Exp[-(x-x0)^2/(2σ^2)] ,{x,-∞,∞},Assumptions->σ>0]

FunctionCentroid[Exp[-(x-x0)^2/(2σ^2)],x,Assumptions->σ>0]

Plot[Exp[-(x-2)^2/(2 1^2)],{x,-10,10},
PlotRange->All,PlotStyle->Red,
AxesLabel->TraditionalForm/@{x,Exp[-InlineFraction[(x-(Subscript[x, 0]))^2,2σ^2]]},
Epilog->{Blue,Dashing[{.02}],PointSize[.03],Point[{2,0}],
Line[{{2,0},{2,1}}]}]