Is the naive solution of this PDE/BVP unique? Problem statement
Suppose I have a 2D or 3D equation of the form:
$\vec{\nabla} \cdot \left[ \vec{\vec{a}}\left(\vec{x}\right)  \cdot \vec{\nabla} f\left(\vec{x}\right) \right] = \vec{\nabla} \cdot \left[ \vec{\vec{a}}\left(\vec{x}\right)  \cdot \vec{S} \left(\vec{x}\right) \right]$
with boundary conditions 
$\left[\vec{\vec{a}}\left(\vec{x}\right) \cdot \left( -\vec{\nabla} f\left(\vec{x}\right) + \vec{S}\left(\vec{x}\right) \right)\right] \cdot \hat{n}\left(\vec{x}\right) =0$
where $\hat{n}$ is the unit vector pointing outward, normal to the simply-connected domain boundary. 
Suppose the rank-2 tensor function $\vec{\vec{a}}\left(\vec{x}\right)$ and vector function $\vec{S}\left(\vec{x}\right)$ are known functions and are continuously-differentiable functions throughout the domain. I wish to solve for $f\left(\vec{x}\right)$ everywhere in the domain. 
This is equivalent to solving $\vec{\nabla} \cdot \vec{A}\left(\vec{x}\right) = 0$ throughout the domain and $\vec{A}\left(\vec{x}\right) \cdot \hat{n}\left(\vec{x}\right) = 0$ at the boundaries, where $\vec{A}\left(\vec{x}\right) = \vec{\vec{a}}\left(\vec{x}\right) \cdot \left[ -\vec{\nabla} f\left(\vec{x}\right) + \vec{S}\left(\vec{x}\right) \right]$. 
Naive solution
The (potentially?) naive solution is $\vec{\nabla} f\left(\vec{x}\right) = \vec{S}\left(\vec{x}\right)$, or $\vec{A}\left(\vec{x}\right)=0$.
My question
Can it be shown with the information provided that the naive solution is the only solution? If not, what conditions would need to be placed on the known variables to make the naive solution unique? 
Of course, $f\left(\vec{x}\right)$ is unique only up to an additive constant. I'm satisfied solving for either that or $\vec{\nabla} f\left(\vec{x}\right)$, which should be unique. 
 A: My answer does not describe a trivial solution to the problem but it suggests how to find one, non-trivial class of solutions under certain conditions.
Let $\nabla\times\vec{A}$ be given. Then we can show that any non-trivial, irrotational solution of the vector Helmholtz equation $\nabla^2\vec{g} = -\nabla\times\vec{A}$, subject to the boundary condition $(\nabla\times\vec{g})\cdot\hat{n} = 0$ will give a non-zero solution to your problem.
Proof: Since $\nabla\cdot\vec{A} = 0$, we can write $\vec{A} = \nabla\times\vec{g}$. If we suppose that $\nabla\times\vec{A} = \vec{C}$ then we have $\nabla\times(\nabla\times\vec{g}) = \vec{C}$. If we choose the "gauge" of $\vec{g}$ such that $\nabla\cdot\vec{g} = 0$ then the we have $\nabla^2\vec{g} = -\vec{C}$.
We further note that the boundary condition $\vec{A}\cdot\hat{n} = 0$ is equivalent to $(\nabla\times\vec{g})\cdot\hat{n} = 0$. 
This is just one way of finding solution to your problem. Even if the conditions are so arranged that the only solution to the above vector Helmholtz equation is the trivial solution, it is not enough to rule our non-trivial solutions to your problem.
[Updated on 22Jul2016 2028 IST]
Since $\vec{S}(\vec{x})$ and $a_{ij}(\vec{x})$ are given functions, we can write the original PDE that you are interested in solving as
\begin{equation}
a_{ij}\frac{\partial^2f}{\partial x_i \partial x_j} + \psi_j\frac{\partial f}{\partial x_j} = \phi(\vec{x}),
\end{equation}
where
\begin{eqnarray}
\psi_j &=& \frac{\partial a_{ij}}{\partial x_i} \\
\phi(\vec{x}) &=& \frac{\partial}{\partial x_i}\left(a_{ij}S_j\right)
\end{eqnarray}
This is a general second order PDE and it will not have a trivial solution unless $\phi(\vec{x}) = 0$ throughout the domain.
