Solutions for $\sum_nA_n\frac{\partial f}{\partial x_n}=B$ I was solving a problem and I encountered the following partial differential equation:
$$\sum_nA_n\frac{\partial f}{\partial x_n}=B$$
where $A_n$ and B are constants and $f:\mathbb{R}^n \longrightarrow \mathbb{R}$ is the function we are trying to find. I have some knowledge on Ordinary differential equations, so I have no idea how to solve this or if it's even possible to solve it. Does such function $f$  exists? If so how do I solve the equasion?
 A: This is a particular case of the method of characteristics, which works for very general equations of order one, even non-linear. We can assume that $A=(A_1,A_2,\dots A_n)\neq 0$, Otherwise any differentiable function would be a solution if $B=0$ or there is no solution if $B\neq 0$. Suppose $A_1\neq 0$. The left hand side of your equation is just the derivative of $f$ along a straight line with direction vector $A$ through the given point. This is just the chain rule,
$$
\frac{df(x(t))}{dt}=\nabla f\cdot \frac{dx}{dt}=\nabla f\cdot A.
$$
Therefore, given a point $x$, you consider a line through it with direction vector $A$ and you move along it until you hit a point where $f$ is known and integrate the resulting ODE from there. Under the assumption $A_1\neq 0$, if you know the value of $f$ on the coordinate plane $x_1=0$, the intersection of that line with the coordinate plane is
$(0,y_2,y_3,\dots y_n)$ such that 
$$
x-(0,y_2,y_3\dots y_n)=At
$$
for some $t$, which gives you $t=x_1/A_1$ and $y_i=A_it=A_ix_1/A_1$. According to your equation, $f$ increases linearly in $t$, with rate $B$. That is,
$$
f(x)=f(0,y_2,y_3\dots y_n)+Bt=f(0,A_2x_1/A_1,A_3x_1/A_1,\dots A_nx_1/A_1)+
$$
$$
+bx_1/A_1
$$
which is an explicit formula for the solution.
If you only know $f(0)=0$ you have infinitely many degrees of freedom for your solution. You have as many as (differentiable) functions $g$ of $n-1$ variables satisfying $g(0)=0$. 
The same argument applies in general, choosing a hyperplane transversal to the vector $A$ (such hyperplanes are called non-characteristic in the general theory, and are the ones where the boundary values determine a unique solution).
