# Weird output when solving this differential equation [closed]

I encountered this weird output when solving this differential equation.

The problem:

Solve y' + y tan(x) = sin(2 x) given y=2 when x=0 and verify the solution.

My code:

In: DSolve[{y'[x] + y[x] tan[x] == sin[2 x], y[0] == 2}, y,x]
Out: DSolve[{tan[x] y[x] + y'[x] == sin[2 x], True}, y,x]


But there is an error message saying: Equation or list of equations expected instead of True in the first argument {tan[x]y[x]+y'[x]==sin[2x],True}.

However, when I solved it without using the initial condition it worked! I don't understand the reason why.

DSolve[{y'[x] + y[x] tan[x] == sin[2 x]}, y,x]


I have checked all the relevant documentations about syntax etc, but still I couldn't figure out what were the mistakes I had made for both cases.

I will really appreciate if anyone could help me figure these out. Many thanks!

-
You are aware that the trigonometric functions are Sin[] and Tan[], and not what you've written? Capitalization matters here. –  Ｊ. Ｍ. Jun 5 '13 at 2:39
@0x4A4D. Thanks! you are right, how could I have been so careless.. –  user71346 Jun 5 '13 at 2:47
y[0] == 2 is evaluating to True. You can test this by evaluating y[0] == 2 in a new cell. This is because y has been defined.
Please try clearing y by running Clear[y] and then rerunning the DSolve command. If this doesn't work, evaluate the command Quit and then run the DSolve command.