Analytic function
In mathematics, an analytic function is a function that is locally given by a convergent power series. Analytic functions can be thought of as a bridge between polynomials and general functions. There exist both real analytic functions and complex analytic functions, categories that are similar in some ways, but different in others. Functions of each type are infinitely differentiable, but complex analytic functions exhibit properties that do not hold generally for real analytic functions. A function is analytic if and only if it is equal to its Taylor series in some neighborhood of every point.

# Definitions
Formally, a function  is real analytic on an open set D in the real line if for any x0 in D one  can write
f(x) = \sum_{n=0}^\infty a_n \left( x-x_0 \right)^n = a_0 + a_1 (x-x_0) + a_2 (x-x_0)^2 + a_3 (x-x_0)^3 + \cdots
in which the coefficients a0, a1, ... are real numbers and the series is convergent for x in a 
neighborhood of x0.
Alternatively, an analytic function is an infinitely differentiable function such that the Taylor series at any point x0 in its domain
T(x) = \sum_{n=0}^{\infin} \frac{f^{(n)}(x_0)}{n!} (x-x_0)^{n}
converges to (x) for x in a neighborhood of x0. The set of all real analytic functions on a given set D is often denoted by C(D).
A function  defined on some subset of the real line is said to be real analytic at a point x if there is a neighborhood D of x on which  is real analytic.
The definition of a complex analytic function is obtained by replacing, in the definitions above, "real" with "complex" and "real line" with "complex plane."

# Examples
Most special functions are analytic (at least in some range of the complex plane). Typical examples of analytic functions are:
- Any polynomial (real or complex) is an analytic function. This is because if a polynomial has degree n, any terms of degree larger than n in its Taylor series expansion will vanish, and so this series will be trivially convergent.
- The exponential function is analytic. Any Taylor series for this function converges not only for x close enough to x0 (as in the definition) but for all values of x (real or complex).
- The trigonometric functions, logarithm, and the power functions are analytic on any open set of their domain.
Typical examples of functions that are not analytic are:
- The absolute value function when defined on the set of real numbers or complex numbers is not everywhere analytic because it is not differentiable at 0. Piecewise defined functions (functions given by different formulas in different regions) are typically not analytic where the pieces meet.
- The complex conjugate function z\to \overline z is not complex analytic, although its restriction to the real line is real analytic.

# Alternate characterizations
If  is an infinitely differentiable function defined on an open set D \subset \mathbb{R}, then the following conditions are equivalent.
The real analyticity of a function  at a given point x can be characterized using the FBI transform.
Complex analytic functions are exactly equivalent to holomorphic functions, and are thus much more easily characterized.

# Properties of analytic functions
- The sums, products, and compositions of analytic functions are analytic.
- The reciprocal of an analytic function that is nowhere zero is analytic, as is the inverse of an invertible analytic function whose derivative is nowhere zero. (See also the Lagrange inversion theorem.)
- Any analytic function is smooth, that is, infinitely differentiable. The converse is not true; in fact, in a certain sense, the analytic functions are sparse compared to all infinitely differentiable functions.
- For any open set   C, the set A() of all bounded, analytic functions u :   C is a Banach space with respect to the supremum norm.  The fact that uniform limits of analytic functions are analytic is an easy consequence of Morera's theorem.
A polynomial cannot be zero at too many points unless it is the zero polynomial (more precisely, the number of zeros is at most the degree of the polynomial). A similar but weaker statement holds for analytic functions. If the set of zeros of an analytic function  has an accumulation point inside its domain, then  is zero everywhere on the connected component containing the accumulation point.
More formally this can be stated as follows. If (rn) is a sequence of distinct numbers such that (rn) = 0 for all n and this sequence converges to a point r in the domain of D, then  is identically zero on the connected component of D  containing r.
Also, if all the derivatives of an analytic function at a point are zero, the function is constant on the corresponding connected component.
These statements imply that while analytic functions do have more degrees of freedom than polynomials, they are still quite rigid.

# Analyticity and differentiability
As noted above, any analytic function (real or complex) is infinitely differentiable (also known as smooth, or C). (Note that this differentiability is in the sense of real variables; compare complex derivatives below.) There exist smooth real functions which are not analytic: see non-analytic smooth function. In fact there are many such functions, and the space of real analytic functions is a proper subspace of the space of smooth functions.
The situation is quite different when one considers complex analytic functions and complex derivatives. It can be proved that any complex function differentiable (in the complex sense) in an open set is analytic. Consequently, in complex analysis, the term analytic function is synonymous with holomorphic function.

# Real versus complex analytic functions
Real and complex analytic functions have important differences (one could notice that even from their different relationship with differentiability). Analyticity of complex functions is a more restrictive property, as it has more restrictive necessary conditions and complex analytic functions have more structure than their real-line counterparts.
According to Liouville's theorem, any bounded complex analytic function defined on the whole complex plane is constant. This statement is clearly false for real analytic functions, as illustrated by
Also, if a complex analytic function is defined in an open ball around a point x0, its power series expansion at x0 is convergent in the whole ball. This is not true in general for real analytic functions. (Note that an open ball in the complex plane would be a disk, while on the real line it would be an interval.)
Any real analytic function on some open set on the real line can be extended to a complex analytic function on some open set of the complex plane. However, not every real analytic function defined on the whole real line can be extended to a complex function defined on the whole complex plane. The function  (x) defined in the paragraph above is a counterexample, as it is not defined for x = i.

# Analytic functions of several variables
One can define analytic functions in several variables by means of power series in those variables (see power series). Analytic functions of several variables have some of the same properties as analytic functions of one variable. However, especially for complex analytic functions, new and interesting phenomena show up when working in 2 or more dimensions. For instance, zero sets of complex analytic functions in more than one variables are never discrete.