Underlying utility function behind a linear two-product demand curve I am trying to find the underlying utility function behind a linear two-product demand model. For that, I use two methods considering the following utility function:
\begin{equation}
U(q_1,q_2) = \alpha_1q_1 + \alpha_2q_2  - \frac{1}{2}(q_1^2+q_2^2+2\epsilon q_1 q_2).
\end{equation}
First, I do utility maximization without explicitly considering the budget constraint. Second, I do the maximization with explicitly stating the budget constraint. The former method gives me linear demand functions, whereas the latter does not. I am not sure why there is this difference. More specifically,
I first solve the utility maximization problem as:
\begin{equation}
\max_{q_1,q_2} \alpha_1q_1 + \alpha_2q_2  - \frac{1}{2}(q_1^2+q_2^2+2\epsilon q_1 q_2) - p_1 q_1 - p_2q_2
\end{equation}
Then, the optimal solution is given as
\begin{align*}
q_1 (p_1,p_2) &= \frac{\alpha_1 - \epsilon\alpha_2 -p_1 +\epsilon p_2}{1-\epsilon^2} \\
q_2 (p_1,p_2) &= \frac{\alpha_2 - \epsilon\alpha_1 -p_2 +\epsilon p_1}{1-\epsilon^2}
\end{align*}
Both of these demand functions are linear in prices $p_1$ and $p_2$, which is what I am looking for. However, when I consider a budget constraint, that is when I consider a constrained maximization problem of the following form:
\begin{align*}
\max_{q_1,q_2} & \alpha_1q_1 + \alpha_2q_2  - \frac{1}{2}(q_1^2+q_2^2+2\epsilon q_1 q_2)  \\
\text{s.t. }&   p_1 q_1 + p_2q_2 \le m,
\end{align*}
I obtain the following two demand functions:
\begin{align*}
q_1 (p_1,p_2;m) &= \frac{mp_1 + \alpha_1 p_2^2 - \alpha_2 p_1 p_2 - \epsilon m p_2}{p_1^2-2\epsilon p_1 p_2 + p_2^2} \\
q_2 (p_1,p_2;m) &= \frac{mp_2 + \alpha_2 p_1^2 - \alpha_1 p_1 p_2 - \epsilon m p_1}{p_1^2-2\epsilon p_1 p_2 + p_2^2}
\end{align*}
The problem is that these demand functions are not linear. How should I interpret this discrepancy?
 A: Hint: First, start off with the constrained maximization problem and then use the Lagrangian method to get the first-order conditions. Then use the Kuhn-Tucker method (see Mathematics for Economist by Simon and Blume) to solve for your optimal demands. 
The consumer solves the following maximization problem:
\begin{align*}
\max_{q_1,q_2} \alpha_1q_1 + \alpha_2q_2  - \frac{1}{2}(q_1^2+q_2^2+2\epsilon q_1 q_2)  \\
\text{s.t. }  p_1 q_1 + p_2q_2 \le m.
\end{align*}
The Lagrangian associated with maximization problem is
\begin{equation*}
  \mathcal{L} = \alpha_1q_1 + \alpha_2q_2  - \frac{1}{2}(q_1^2+q_2^2+2\epsilon q_1 q_2) + \lambda[m - p_1 q_1 - p_2q_2]
\end{equation*}
Then take the derivatives of $\mathcal{L}$ wrt to $q_{1}$, $q_{2}$, and $\lambda$ to get the following first-order conditions:
\begin{equation}
 \frac{\partial \mathcal{L}}{\partial q_{1}}=\alpha_{1}-q_{1}+\epsilon q_{2} -\lambda p_{1} =0 
\end{equation}
\begin{equation}
 \frac{\partial \mathcal{L}}{\partial q_{2}}=\alpha_{2}-q_{2}+\epsilon q_{1} -\lambda p_{2}=0  
\end{equation}
\begin{equation}
   \frac{\partial \mathcal{L}}{\partial \lambda}=m-p_{1}q_{1}-p_{2}q_{2}\geq0 
\end{equation}
Then we use the Kuhn-Tucker method:
$\lambda[m-p_{1}q_{1}-p_{2}q_{2}] = 0$ is the complementary slackness condition on $\lambda$
and 
$\lambda\geq0$ is the non-negativity constraint on $\lambda$.
We can have two cases: either $\lambda>0$ or $\lambda=0$. I show what happens for $\lambda>0$ and then you can check what happens for $\lambda=0$.
If $\lambda>0$ then $m-p_{1}q_{1}-p_{2}q_{2}=0$ by the complementary slackness condition. In other words, this is the case where the budget constraint is binding, that is, $m=p_{1}q_{1}-p_{2}q_{2}$. Then we check whether the first-order conditions and the non-negativity condition hold.
After doing so we are left with the following set of equations:
\begin{equation}
 \frac{\partial \mathcal{L}}{\partial q_{1}}=\alpha_{1}-q_{1}+\epsilon q_{2} -\lambda p_{1} =0 
\end{equation}
\begin{equation}
 \frac{\partial \mathcal{L}}{\partial q_{2}}=\alpha_{2}-q_{2}+\epsilon q_{1} -\lambda p_{2}=0  
\end{equation}
\begin{equation}
   m-p_{1}q_{1}-m_{2}q_{2}=0 
\end{equation}
Then substitute away $\lambda$ from the first two equations and solve for $q_{1}$ and $q_{2}$ using the binding budget constraint.
Edit: For the unconstrained problem you have no budget constraint so your set up is conceptually wrong. The way you get an unconstrained problem from a constrained problem is that you substitute away your budget constraint in the utility function. Also I haven't imposed non-negative conditions on $q_{1}$ and $q_{2}$, as then the process would be quite tedious. 
A: in the first case you implicitly assumed that your utility function is of the quasi-linear type, i.e. there is a fully specified utility function u(q1,q2,y) = U(q1,q2) + y (using your notation for utility over goods and where "y" is the numeraire good or just money). There is nothing wrong with this, and this is actually done in most of Industrial Organization when cross-effects between markets are neglected. If you formulate your problem using this fully specified utility function AND a budget constraint, you end up solving the problem you wrote down in the text.
The second approach you have is also correct -- but you are using a different utility function (and therefore get different results).
