In a transverse wave, the quatity that is oscillating is doing so in a direction perpendicular to the direction of propagation of the wave. Exemples: 1) Water waves: here, it is the water level that rises and sinks in the y direction but the disturbance is propagating in the x direction. 2) A (free) electromagnetic wave. Here is it the value of the E and B fields that each oscillate in plane perpendicular to the direction of propagation.
In a longitudinal wave, the thing that is oscillating is doing so in the direction of propagation. For exemple, the pressure in an air wave (sound).
There are waves that are neither too. The density wave in the air wave for instance. Density is not a vector, it just takes some value.
Wheter you can tell or not from just the wave equation is kind of an ambiguous question, because usually, what happens is that you start witj Newtonian mechanics, and you write the force equations and after a few manipulations, it becomes the wave equation. But by then, you know what is oscillating and you know in which direction. So you will probably write the wave equation for pressure as such:
[tex]v^2\partial_{xx} p_x(x,t)-\partial_{tt}p_x(x,t)=0[/tex]
and by the x subscript it is apparent that is it the x-component of pressure that oscillates.
In an electromagnetic wave though, we start with a set of 4 equations, and we combine them to create a wave equation. Then we solve it, and THEN, we find that for it to satisfy the original 4 equations, the wave must be transverse. So in that case, we could not tell it is was transverse or longitidinal b4 solving it.
Wheter a wave is longitudinal or transverse is more or a physical thing than a mathematical thing you can see right from the wave equation.