## UnkleRhaukus 2 years ago $y'(x)-y\tan(x)=2\sin(x)h(x)$ [where $$h(t)$$ is the heaviside unit step function ]

1. Outkast3r09

are you like majoring in Math with study in Differential Equations?

2. UnkleRhaukus

\newcommand\dd[1]{\,\mathrm d#1} % infinitesimal \newcommand\intl[4]{\int\limits_{#1}^{#2}{#3}{\dd #4}} % integral _{a}^{b}{f(x)}\dd \begin{align*} y'(x)-y\tan(x)&=2\sin(x)h(x)\\ \\ \mu(x)=e^{\int{-\tan(x)}\dd x}\\ =e^{\int\frac{-\sin(x)\dd x}{\cos(x)}}\\ =e^{\ln\cos(x)}\\ =\cos(x)\\ \\ \left(y\cos(x)\right)'=&2\cos(x)\sin(x)h(x)\\ y\cos(x)&=2\int\cos(x)\sin(x)h(x)\dd x\\ &=\int\sin(2x)h(x)\dd x\\ \\ \end{align*}

3. UnkleRhaukus

im not sure what i should do with the h(x) in the indefinite integral

4. UnkleRhaukus

Im majoring in nuclear science technologies.

5. Outkast3r09

i haven't seen this stuff lol. Perhaps integrate as a function

6. Outkast3r09

i mean sin(2x). i think one of the two... still haven't remembered those 100%

7. Outkast3r09

oh i see you already did that lol

8. UnkleRhaukus

$h(x)=\begin{cases}0&x<0\\1&x>0\end{cases}$

9. Outkast3r09

it says h(t)

10. Outkast3r09

why do you have h(x)

11. UnkleRhaukus

whatever

12. Outkast3r09

lol i'd have to see notes on how to do this... otherwise im not much help

13. UnkleRhaukus

can i take the step function out of the integral ?

14. Outkast3r09

I dont think so =/ only constants can come out

15. UnkleRhaukus

i know how to integrate definite integrals with the step function , but i dont know a about indefinite integrals.

16. UnkleRhaukus

@abb0t

17. sirm3d

it's a two-part DE. $y'-y \tan x = 0, \qquad x < 0\\y' - y \tan x = 2 \sin x, \quad x \geq 0$

18. UnkleRhaukus

something like this?\newcommand\dd[1]{\,\mathrm d#1} % infinitesimal \newcommand\intl[4]{\int\limits_{#1}^{#2}{#3}{\dd #4}} % integral _{a}^{b}{f(x)}\dd x \begin{align*} y\cos(x)&=2\int\cos(x)\sin(x)h(x)\dd x\\ &=\int\sin(2x)h(x)\dd x\\ \\ &= \begin{cases} \int\sin(2x)\dd x &x\geq0\\ 0 &x<0 \end{cases}\\ &= \begin{cases} \frac{-\cos(2x)}{2}+c &x\geq0\\ 0 &x<0 \end{cases}\\ y&= \begin{cases} \frac{-\cos(2x)}{2\cos(x)}+c &x\geq0\\ 0 &x<0 \end{cases}\\ &= \begin{cases} \frac{1-\cos^2(x))}{2\cos(x)}+c &x\geq0\\ 0 &x<0 \end{cases}\\ &= \begin{cases} \frac12\big(\sec(x)-\cos(x)\big)+c &x\geq0\\ 0 &x<0 \end{cases}\\ \end{align*}

19. sirm3d

$y=\begin{cases}-\frac{\cos 2x}{2\cos x}+C_1 &, x\geq 0\\\sec x+c_2 & ,x<0\end{cases}$

20. sirm3d

$y=\begin{cases}\frac{-(1/2)\cos 2x}{\cos x}+c_1&=\frac{1+\sin ^2 x-(3/2)}{\cos x}+C_1\\\sec x +C_2& =\frac{1}{\cos x}+C_2\end{cases}$ $y=\begin{cases}\frac{1}{\cos x}+\frac{\sin ^2 x-(3/2)}{\cos x}+C_1\\\frac{1}{\cos x}+C_2\end{cases}$ $\Large y = \frac{1}{\cos x} + \frac{\sin^2 x - (3/2)}{\cos x}h(x) + C$

21. UnkleRhaukus

\newcommand\dd[1]{\,\mathrm d#1} % infinitesimal \newcommand\intl[4]{\int\limits_{#1}^{#2}{#3}{\dd #4}} % integral _{a}^{b}{f(x)}\dd x \newcommand\de[2]{\frac{\mathrm d #1}{\mathrm d#2}} % first order derivative \begin{align*} y'(x)-y\tan(x)&=2\sin(x)h(x)\\ &=\begin{cases}0,&x<0\qquad \text{I}\\2\sin(x),&x\geq0\qquad \text{II}\end{cases}\\ \qquad \text{I for } x<0\\ \\ y'-y\tan(x)&=0\\ \de yx&=y\tan(x)\\ \frac{\dd y}{y}&=\tan(x)\dd x\\ \ln y&=\int\tan(x)\dd x\\ \ln y&=-\ln \cos(x)+c_1\\ y&=k\sec(x)\\ \\ \qquad \text{II for } x\geq0&\\ \\ y'(x)-y\tan(x)&=2\sin(x)\\ \\ \mu(x)=e^{\int{-\tan(x)}\dd x}\\ =e^{\int\frac{-\sin(x)\dd x}{\cos(x)}}\\ =e^{\ln\cos(x)}\\ =\cos(x)\\ \\ \left(y\cos(x)\right)' &=2\cos(x)\sin(x)\\ &=\sin(2x)\\ y\cos(x) &=\int\sin(2x)\dd x\\ &=\frac{-\cos(2x)}{2}+c_2\\ y &=\frac{-\cos(2x)}{2\cos(x)}+c_2\\ &=\frac{1-2\cos^2(x))}{2\cos(x)}+c_2\\ y&=\frac{\sec(x)}2-\cos(x)+c_2\\ \\ \end{align*}

22. abb0t

i don't think im getting notifications on OS lately cuz i didn't even get the mention. i just ran across this question right now o.0

23. UnkleRhaukus

\newcommand\dd[1]{\,\mathrm d#1} % infinitesimal \newcommand\intl[4]{\int\limits_{#1}^{#2}{#3}{\dd #4}} % integral _{a}^{b}{f(x)}\dd x \newcommand\de[2]{\frac{\mathrm d #1}{\mathrm d#2}} % first order derivative \begin{align*} y'(x)-y\tan(x)&=2\sin(x)h(x) &=\begin{cases}0,&x<0\qquad \text{I}\\2\sin(x),&x\geq0\qquad \text{II}\end{cases}\\ \qquad \text{I for } x<0\\ \\ y'-y\tan(x)&=0\\ \de yx&=y\tan(x)\\ \frac{\dd y}{y}&=\tan(x)\dd x\\ \ln y&=\int\tan(x)\dd x\\ \ln y&=-\ln \cos(x)+c_1\\ y&=k\sec(x)\\ \\ \qquad \text{II for } x\geq0&\\ \\ y'(x)-y\tan(x)&=2\sin(x)\\ \\ \mu(x)=e^{\int{-\tan(x)}\dd x}\\ =e^{\int\frac{-\sin(x)\dd x}{\cos(x)}}\\ =e^{\ln\cos(x)}\\ =\cos(x)\\ \\ \big(y\cos(x)\big)' &=2\cos(x)\sin(x)\\ &=\sin(2x)\\ y\cos(x) &=\int\sin(2x)\dd x\\ &=\frac{-\cos(2x)}{2}+c_2\\ y &=\frac{-\cos(2x)}{2\cos(x)}+\frac{c_2}{\cos(x)}\\ &=\frac{1-2\cos^2(x))}{2\cos(x)}+c_2\sec(x)\\ &=\frac{\sec(x)}2-\cos(x)+c_2\sec(x)\\ &=\frac{(1+2c_2)\sec(x)}2-\cos(x)\\ &=c_3\sec(x)-\cos(x)\\ \end{align*}

24. UnkleRhaukus

so $y(x)=k\sec(x)+\big(c_3\sec(x)-\cos(x)\big)h(x)$$=\big(k+c_3h(x)\big)\sec(x)-\cos(x)h(x)$ right?

25. phi

close, but I think you want the k sec(x) term to go away for x≥0, right? one way to do this is multiply it by h(-x)

26. UnkleRhaukus

oh yeah i didn't think about that , also the solution to a 1st order DE should only have one constant right?

27. phi

I don't know how many constants should be in this problem (I only know enough to be dangerous). But if that is the case, it would be nice, because you could write your solution as x<0 c1 sec(x) x≥0 c2 sec(x) - cos(x) if c1 must equal c2 this can be written as c1 sec(x) - cos(x) h(x)

28. UnkleRhaukus

ah cool, that looks good, however i think i made a mistake somewhere in solving y′(x)−ytan(x)=2sin(x) because it dosent agree with the wolf http://www.wolframalpha.com/input/?i=y%27-y*tanx%3D2*sin+x

29. phi

I think a multiple term trig function can take many equivalent forms 1/2* sec(x) - cos(x) = -1/2* cos(2x)*sec(x) http://www.wolframalpha.com/input/?i=plot+1%2F2*sec%28x%29+-cos%28x%29%2C-1%2F2*+cos%282x%29*sec%28x%29

30. phi

I think it comes down to what the constants are for the two branches x<0 and x≥0 we could write x< 0 c1 sec(x) x≥0 c2 sec(x) + 0.5 sec(x) - cos(x) and we could combine the sec(x) and assign a different constant...

31. UnkleRhaukus

Cosine of zero is equal to one so c_1 sec(x) - cos(x) h(x) is not continuous at the boundary. \begin{align*} &y=\begin{cases}k\sec(x)&x<0\qquad \text{(I)}\\c\sec(x)-\cos(x)&x\geq0 \qquad \text{(II)}\end{cases}\\ \\ \\ k\sec(0)=c\sec(0)-\cos(0)&\\ k=c-1\qquad\qquad \\ \\ &y(x)=(k+ch(x))\sec(x)-\cos(x)h(x) \end{align*}

32. UnkleRhaukus

Ah this is better \begin{align*} y&=\begin{cases}k\sec(x)&x<0\qquad \text{(I)}\\c\sec(x)-\cos(x)&x\geq0 \qquad \text{(II)}\end{cases}\\ \\ \\ k\sec(0)=c\sec(0)-\cos(0)\\ k=c-1\qquad\qquad\quad\\ \\ \\ y&=k\sec(x)+\big(\sec x-\cos(x)\big )h(x)\\ &=k\sec(x)+\left(\frac1{\cos(x)}-\frac{\cos^2(x)}{\cos(x)}\right)h(x)\\ &=k\sec(x)+\left(\frac{\sin^2(x)}{\cos(x)}\right)h(x)\\ &=k\sec(x)+\sin(x)\tan(x)h(x)\color{red}\checkmark\\ \end{align*}