Intuition of definition of divergence Intution : 
The divergence of a three-dimensional vector field is the extent to which the vector field flow behaves like a source at a given point.
But if my vector field is $F=\langle P,Q,R\rangle$ then formula is for divergence is given as $P_x+Q_y+R_z$.

I want to know how this formula capute that intutitve idea.

I studied using MIT OCW. But professor didn't talk about how we get formula from the idea. 
So,I see videos from Khan academy, if we consider  $i$ component i.e. $P$ , the divergence is positive ( Intution) if $P_x>0$ and vice versa.similarly for $j,k$ component. But a vector field need not be oriented along axis .he tells something like for an arbitrary vector field we can decompose vectors into components.but I didn't get that thing
Could someone please explain how we get this formula from intution of divergence.
Thanks!
 A: Basically the intuition comes from the divergence theorem, which says that the integral of the divergence of a field $F$ over a volume $V$ is equal to the outward flux of $F$ through the boundary of $V$. By taking the volume small you recover the differential interpretation. 
The divergence theorem itself is more or less a generalization of the fundamental theorem of calculus. Indeed in the 1D situation, the contributions to the outward flux from $[a,b]$ at $a,b$ are $-f(a),f(b)$ respectively (the minus sign coming because the outward normal at $a$ points to the left), so the flux is $f(b)-f(a)$ which is of course $\int_a^b f'(x) dx$.
A: You can use the divergence theorem as the motivation.
We are calculating the flux $\Phi_V$ of the vector field $\vec{F}$ through a closed surface $\partial V$ enclosing the volume $V$. Notice that if we divide $V$ into smaller volumes $V_1, \ldots, V_n$ then
$$\Phi_V = \Phi_{V_1} + \cdots + \Phi_{V_n}$$
because the flux on the dividing surfaces cancels out.
Hence letting $n\to\infty$ and $V_i \to 0$ and using the divergence theorem we get
$$\int_{V} (\operatorname{div} \vec{F})\,dV = \Phi_V = \sum_{i=1}^n\Phi_{V_i}= \sum_{i=1}^n \frac{\Phi_{V_i}}{V_i} V_i\xrightarrow{V_i \to 0}\int_V \left(\lim_{V_i \to 0} \frac{\Phi_{V_i}}{V_i}\right)\,dV$$
Since $V$ was arbitrary, we conclude $\operatorname{div} \vec{F} = \lim_{V_i \to 0} \frac{\Phi_{V_i}}{V_i}$.
To calculate $\operatorname{div} \vec{F}$, consider an infinitesimal box $V = [x, x+dx]\times[ y,y+dy] \times [z,z+dz]$.
Let's calculate the flux through the bottom and the top sides $\Phi_{\text{bottom and top}}$. Since the box is small, we can assume that $\vec{F}$ is constant on each side of the box, and equal to $\vec{F}(x,y,z)$ and $\vec{F}(x,y,z+dz)$ respectively. Hence the flux through the bottom and the top is
\begin{align}\Phi_{\text{bottom and top}} &= \text{area of top}\cdot \vec{F}(x,y,z+dz)\cdot(0,0,1) + \text{area of bottom}\cdot \vec{F}(x,y,z)\cdot (0,0,-1) \\
&= \big(F_z(x,y,z+dz) - F_z(x,y,z)\big)\,dx\,dy \\
&= \left(\frac{\partial F_z}{\partial z}(x,y,z) \,dz\right)\,dx\,dy
\end{align}
By symmetry, the entire flux is
\begin{align}
\Phi_V &= \Phi_{\text{bottom and top}} + \Phi_{\text{left and right}} + \Phi_{\text{front and back}} \\
&= \left(\frac{\partial F_x}{\partial x}(x,y,z) + \frac{\partial F_y}{\partial y}(x,y,z)+\frac{\partial F_z}{\partial z}(x,y,z) \right)\,dx\,dy\,dz
\end{align}
Since the volume of the box is $dV = dx\,dy\,dz$, we have
$$\operatorname{div} \vec{F} = \frac{\Phi_V}{dV} = \frac{\partial F_x}{\partial x}(x,y,z) + \frac{\partial F_y}{\partial y}(x,y,z)+\frac{\partial F_z}{\partial z}(x,y,z)$$
Now, any volume $V$ can be divided into very small boxes, this result holds for any $V$.
