# Plotting the solution of a 2nd order equation

I have got to solve a second order equation, where the coefficient depend on the parameter $k$:

$$(A_k - \omega) (D_k- \omega) - B_kC_k = 0$$

so that also the solution $\omega=\omega(k)$ will depend on $k$. Here's my code.

Parameters:

L = 10; l = 1; w = 0.13;
Subscript[ϕ, 0] = 1; β = 0.1; α = 0.06; η = 0.5; d = 1;
λ = 0.1;


Coefficients:

AA = (((1 - w) kk^2 Pi^2 l^2) / L^2) + (α (Subscript[ϕ, 0 ]^2) (1 - λ))/η;
BB = Pi l w (1 + ((1 - λ)^2/2 η))/L;
CC = -β (Subscript[ϕ, 0 ]^2) Pi l kk/ L;
dd = (Pi l (d - w) kk^2 Pi^2 l^2)/ L^2 ;


Then solving:

sol = Last[Simplify[Solve[(AA - ω) (dd - ω) - BB CC == 0, ω]]]


Now, how do I make Mathematica plot this solution as a function of $k$?

If I try:

Plot[Evaluate[ω[kk]/.sol], {kk, -10, 10}, PlotRange -> All]


it does not work.

Plot [ω /. sol, {kk, -10, 10} ]

• Thanks so much! Just another comment: if I wanted to plot $\omega$ both as a function of k and then show on the same plot several $\omega(k)$ for different values of $\alpha$? Commented Nov 22, 2013 at 14:51
• @usumdelphini Run your code without setting a value for Alpha and then Plot3D[\[Omega] /. sol, {kk, -10, 10}, {\[Alpha], 0, 20}, PlotRange -> All] Commented Nov 22, 2013 at 14:57