By default Solve returns generic solutions, nevertheless one can make use of its new options (in ver. 8) to make it return all solutions in an appropriate form :
MaxExtraConditions - additional (all) solutions can be returned specifying nondefault settings of MaxExtraConditions (default ...-> 0), determining how many equations/conditions on parameters are allowed.
GeneratedParameters (this option had been since ver. 5 in other functions (e.g. in Reduce) but in Solve it hadn't worked before ver. 8) to specify names of parameters of the solutions.
Solution in Mathematica 8
In our case we need MaxExtraConditions -> All and GeneratedParameters -> n:
Solve[ Sin[(π x)/L] == 1, x, MaxExtraConditions -> All, GeneratedParameters -> n]
{{x -> ConditionalExpression[(L (π /2 + 2 π n[1]))/π , n[1] ∈ Integers && L != 0]}}
ConditionalExpression (also new in ver. 8) is an adequate function since this expression is a solution if and only if n[1] is an integer number and L != 0. Nevertheless if we know that these conditions are true, then
ConditionalExpression can be simplified under an adequate assumption (the second argument of Simplify) like e.g. Simplify[ %, n[1] ∈ Integers && L != 0].
It would be more convenient if we did not specify parameters in the assumption but used directly the output of Solve in Simplify. We can do it by taking an appropriate part of the result of Solve, therefore our preferred solution is the following :
Solve[ Sin[(π x)/L] == 1, x, GeneratedParameters -> n, MaxExtraConditions -> All] //
Simplify[#, #[[1, 1, 2, 2]]] &
{{x -> 1/2 L (1 + 4 n[1])}}
Edit
Equivalent result in Mathematica 7
In Mathematica 7 we couldn't use GeneratedParameters nor MaxExtraConditions in Solve. Nevertheless we could make (for fun) the output of Reduce similar to that of Solve in M 8. In this specific case an analogical expresion to ConditionalExpression is returned e.g. by
If @@ {And @@ Most @ #, Rule @@ Last @ #}& [
List @@ Reduce[ Sin[(π x)/L] == 1, x, GeneratedParameters -> n] ]
If[n[1] ∈ Integers && L != 0, x -> (L (π/2 + 2 π n[1]))/π]
and to get an appropriately simplified expression we can do e.g.
{{ Simplify[ #, #[[1]] ] &[ If @@ {And @@ Most @ #, Rule @@ Last @ #} &[
List @@ Reduce[ Sin[(π x)/L] == 1, x, GeneratedParameters -> n] ] ] }}
{{x -> 1/2 L (1 + 4 n[1])}}
Making any replacements (as in other answers) in the output of Solve can be quite arbitrary and therefore it is not very convenient, nevertheless that way would provide simpler method to modify the output, on the other hand as stated before, in general Solve could not return all solutions in ver. 7.
2ninstead ofn(Sinhas a period2 Pi). My answer gives a recommended way to tackle your problem. – Artes Jul 26 '12 at 12:00