class_docstr: Symbolic expression for the variance.
  
  Examples
  ========
  
  >>> from sympy import symbols, Integral
  >>> from sympy.stats import Normal, Expectation, Variance, Probability
  >>> mu = symbols("mu", positive=True)
  >>> sigma = symbols("sigma", positive=True)
  >>> X = Normal("X", mu, sigma)
  >>> Variance(X)
  Variance(X)
  >>> Variance(X).evaluate_integral()
  sigma**2
  
  Integral representation of the underlying calculations:
  
  >>> Variance(X).rewrite(Integral)
  Integral(sqrt(2)*(X - Integral(sqrt(2)*X*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)))**2*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo))
  
  Integral representation, without expanding the PDF:
  
  >>> Variance(X).rewrite(Probability)
  -Integral(x*Probability(Eq(X, x)), (x, -oo, oo))**2 + Integral(x**2*Probability(Eq(X, x)), (x, -oo, oo))
  
  Rewrite the variance in terms of the expectation
  
  >>> Variance(X).rewrite(Expectation)
  -Expectation(X)**2 + Expectation(X**2)
  
  Some transformations based on the properties of the variance may happen:
  
  >>> from sympy.abc import a
  >>> Y = Normal("Y", 0, 1)
  >>> Variance(a*X)
  Variance(a*X)
  
  To expand the variance in its expression, use ``expand()``:
  
  >>> Variance(a*X).expand()
  a**2*Variance(X)
  >>> Variance(X + Y)
  Variance(X + Y)
  >>> Variance(X + Y).expand()
  2*Covariance(X, Y) + Variance(X) + Variance(Y)
class_docstr_tok: ["Symbolic","expression","for","the","variance",".","Examples","========",">",">",">","from","sympy","import","symbols",",","Integral",">",">",">","from","sympy.stats","import","Normal",",","Expectation",",","Variance",",","Probability",">",">",">","mu","=","symbols","(","``","mu","''",",","positive=True",")",">",">",">","sigma","=","symbols","(","``","sigma","''",",","positive=True",")",">",">",">","X","=","Normal","(","``","X","''",",","mu",",","sigma",")",">",">",">","Variance","(","X",")","Variance","(","X",")",">",">",">","Variance","(","X",")",".evaluate_integral","(",")","sigma","*","*","2","Integral","representation","of","the","underlying","calculations",":",">",">",">","Variance","(","X",")",".rewrite","(","Integral",")","Integral","(","sqrt","(","2",")","*","(","X","-","Integral","(","sqrt","(","2",")","*","X","*","exp","(","-","(","X","-","mu",")","*","*","2\/","(","2","*","sigma","*","*","2",")",")","\/","(","2","*","sqrt","(","pi",")","*","sigma",")",",","(","X",",","-oo",",","oo",")",")",")","*","*","2","*","exp","(","-","(","X","-","mu",")","*","*","2\/","(","2","*","sigma","*","*","2",")",")","\/","(","2","*","sqrt","(","pi",")","*","sigma",")",",","(","X",",","-oo",",","oo",")",")","Integral","representation",",","without","expanding","the","PDF",":",">",">",">","Variance","(","X",")",".rewrite","(","Probability",")","-Integral","(","x","*","Probability","(","Eq","(","X",",","x",")",")",",","(","x",",","-oo",",","oo",")",")","*","*","2","+","Integral","(","x","*","*","2","*","Probability","(","Eq","(","X",",","x",")",")",",","(","x",",","-oo",",","oo",")",")","Rewrite","the","variance","in","terms","of","the","expectation",">",">",">","Variance","(","X",")",".rewrite","(","Expectation",")","-Expectation","(","X",")","*","*","2","+","Expectation","(","X","*","*","2",")","Some","transformations","based","on","the","properties","of","the","variance","may","happen",":",">",">",">","from","sympy.abc","import","a",">",">",">","Y","=","Normal","(","``","Y","''",",","0",",","1",")",">",">",">","Variance","(","a","*","X",")","Variance","(","a","*","X",")","To","expand","the","variance","in","its","expression",",","use","``","expand","(",")","``",":",">",">",">","Variance","(","a","*","X",")",".expand","(",")","a","*","*","2","*","Variance","(","X",")",">",">",">","Variance","(","X","+","Y",")","Variance","(","X","+","Y",")",">",">",">","Variance","(","X","+","Y",")",".expand","(",")","2","*","Covariance","(","X",",","Y",")","+","Variance","(","X",")","+","Variance","(","Y",")"]
code: def __new__(cls, arg, condition=None, **kwargs):
      arg = _sympify(arg)
  
      if arg.is_Matrix:
          from sympy.stats.symbolic_multivariate_probability import (
              VarianceMatrix,
          )
  
          return VarianceMatrix(arg, condition)
      if condition is None:
          obj = Expr.__new__(cls, arg)
      else:
          condition = _sympify(condition)
          obj = Expr.__new__(cls, arg, condition)
      obj._condition = condition
      return obj
  
imports: import itertools
  from sympy.concrete.summations import Sum
  from sympy.core.add import Add
  from sympy.core.expr import Expr
  from sympy.core.function import expand
  from sympy.core.mul import Mul
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.integrals.integrals import Integral
  from sympy.logic.boolalg import Not
  from sympy.core.parameters import global_parameters
  from sympy.core.sorting import default_sort_key
  from sympy.core.sympify import _sympify
  from sympy.core.relational import Relational
  from sympy.logic.boolalg import Boolean
  from sympy.stats import variance, covariance
  from sympy.stats.rv import RandomSymbol, pspace, dependent, given, sampling_E, RandomIndexedSymbol, is_random, PSpace, sampling_P, random_symbols
label_desc: Use image node_id 1 for calling the Variance obj's underlying member method code with example usage: obj.__new__(cls, arg, condition) and returns: obj, VarianceMatrix