Why we do calculus of variation instead of finding maxima or miniama of function? Why we do calculus of variation instead of finding maxima or minima of function?
What is the difference between finding maxima or mimima i.e. critical point of a function and calculus of variation?
 A: Calculus of variations is used to find maxima and minima of functionals.
The usual functions $f(x)$ are from some set of numbers to another. For example,
$$f: \mathbf{R} \to \mathbf{C}$$
Functionals $F[f]$ are from a a vector space (usually of functions) to real numbers:
$$F: \mathcal V \to \mathbf R$$
Basically they are mathematical quantities depending on functions, whereas the usual functions depend on numbers. For example, the one-dimensional definite integral
$$I[f] = \int_a^bf(x) \ dx$$
is a functional, and we could ask ourselves, for example, what function minimizes this functional under some constraint.
A: Calculus of variations does for continuous functions what finding extrema via differentiation does for discrete variables.
If you are minimizing $F(y_0,y_1,y_2,\ldots)$, then you differentiate with respect to all variables $y_0,y_1,\ldots$ and equate the derivatives with zero. The result is a set of variables which minimize $F$.
If you are mizing $F(y(x))$, you have an uknown $y$ for each $x$, which is a continuous variable. So in essence, you are looking for a function $y(x)$ which minimizes $F$. This is the same as before, but the mathematical procedure looks a bit different, because usually, the functional $F$ involves derivatives of $y$, which couples the neighboring points $y$. The end result of minimization is a function $y(x)$, which you can think of as an infinitely dense vector of values.
This gives you the connection, which is used every day in numerical simulations. As soon as you approximate a function with discrete points, you get from the second to the first method.
Consider
$$F(y(x))=\int \left(-y^2+\left(\frac{dy}{dx}\right)^2\right)dx$$
Calculus of variations gives you $d^2 y/dx^2+y=0$ with solutions $y=\{\sin,\cos\}(x)$. Now say you want $y(x)$ sampled at regular intervals: $y(0)=y_0$, $y(h)=y_1$, $y(2h)=y_2$,... Use the discrete approximation for the derivative, realize that integration is summation in discrete terms, and you get
$$F(y(x))\approx F(y_i)=-h\sum y_i^2+h\sum \left(\frac{y_{i+1}-y_i}{h}\right)^2$$
Now, to minimize this, you just differentiate with respect to $y_i$, and you get:
$$\frac{dF}{d y_i}=2h( y_i+ (y_{i+1}-2y_i+y_{i-1})/h^2)=0$$
The second terms comes from two neighboring terms which contain $y_i$ (the left and right derivative squared). What's this? Exactly the discrete version of the previously computed differential equation.
So... the two methods are exactly the same. The difference comes from the fact, that functionals $F(y)$ we usually encounter in physics, don't have non-local coupling of points at different $x$, but have differential terms, which are minimized using Euler-Lagrange procedure.
A: A function F(x) is said to have  a maximum value at x=a ,  if F(x)  is greater than any value immediately preceding or following.
We say that a function F(x)  has a  minimum value at x=b , if F(x)  is less than any value immediately preceding or following.
If we look at the graph a high point is called a maximum and a low point is called a minimum .
The general word for maximum or minimum is extremum .
We say local maximum (or minimum) when there may be higher (or lower) points elsewhere but not nearby.
The process of differentiation and taking the slope to be flat at maxima or minima is used. One determines the nature of maxima/minima by looking at the sign of the second derivative at the point.
From the Wikipedia article (paragraphs not in order):

Calculus of variation is a [type] of analysis that deals with maximizing or minimizing functionals.
A functional depends on a function somewhat analogous to the way a function can depend on a numerical parameter, and thus a functional is usually  described as a function of a function.
Functionals are often expressed as definite integrals involving functions and their derivatives. 
The [calculus of] variation   is concerned with the maxima or minima of functionals, which are collectively called extrema.
  The interest is in extremal functions that make the functional attain a maximum or minimum value – or  stationary functions .
An  example of such a variational problem is to find the curve of shortest length connecting two points. If there are no further  conditions, the solution is a straight line between the  two  points.
However, if the curve is constrained to lie on a particular surface then  possibly many solutions for the path called geodesics may exist.
A related [variational] problem is posed by  Fermat’s Principle : light follows the path of shortest optical length connecting two points, where the optical length depends upon the material of the medium. 
One [similar]  concept in mechanics is the principle of least action. The action integral is extremum for the real path taken by the system.
Functionals have extrema with respect to the elements $y$ of a given function space defined over a given domain.
Both strong and weak extrema of functionals are for a space of continuous functions but weak extrema have the additional requirement that the first derivatives of the functions in the space be continuous. [...] An example of a necessary condition  is used for finding weak extrema is the
  Euler-Lagrange equation.

In physics both one-dimensional and multi-dimensional eigenvalue problems can also be formulated as variational problems.
