$cos("dy"/"dx") = "a"$
$"dy"/"dx" = cos^-1 "a"$
dy = (cos-1 a) dx
Integrating both sides, we get
$int "dy" = (cos^-1 "a") int "dx"$
y = (cos-1 a) x + c
y = x cos-1 a + c
This is a general solution.
Now, y(0) = 2, i.e. y = 2, when x = 0
2 = 0 + c
c = 2
the particular solution is
y = x cos-1 a + 2
y - 2 = x cos-1 a
$("y" - 2)/"x" = cos^-1 "a"$
$cos (("y - 2")/"x")$ = a.