Answer:

Step-by-step explanation:
The first case is a special case of the second one, so we will solve the question for the second case first.
Consider
. Using the properties of derivatives and the derivatives of trigonometric functions we get that


We have the equation
. Note that since
then we have the equation
,
which implies that
. Then, 
Note that in this case, the value of k doesn't depend on the values of A and B. So, it applies to every value of A and B. The first case is included, since it is the case in which A=0 and B=1.