# Solve differential equation a\*x'+b\*x=|sin(w\*t)| on Mathematica calling W|A?

**URL:** <https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658>\
**Category:** Questions\
**Tags:** wolfram-alpha, calculus, equation-solving\
**Created:** [May 28, 2016, 10:55pm UTC](https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658 "2016-05-28T22:55:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gennaroarguzzi](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@gennaroarguzzi](https://community.wolfram.com/u/gennaroarguzzi)\
**Post date:** [May 28, 2016, 10:55pm UTC](https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658/1 "2016-05-28T22:55:35Z")

</div>

Hi everyone, how could I solve the differential equation a_x’+b_x=|sin(w\*t)| with x(0)=0 on Mathematica?  
Thank you for your time.

---

<div class="post-metadata">

**Author:** ![bsimpson141421356](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@bsimpson141421356](https://community.wolfram.com/u/bsimpson141421356)\
**Post date:** [May 29, 2016, 5:14am UTC](https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658/2 "2016-05-29T05:14:31Z")

</div>

If you can justify rewriting |sin(w \* t)| as sqrt(sin(w \* t)^2) and you carefully study the examples

[here](https://reference.wolfram.com/language/ref/DSolve.html)

to understand the notation that Mathematica demands then you should be able to use Mathematica to solve your problem.

If you try it and it doesn’t work then post showing exactly what you have done and someone might see what the problem is.

Watch out for capitalization of names and use of () versus [] versus {} as those are all different and Mathematica expects all this to be done in the required format.  
[1]: [DSolve: Solve a differential equation—Wolfram Documentation](https://reference.wolfram.com/language/ref/DSolve.html)

---

<div class="post-metadata">

**Author:** ![gennaroarguzzi](https://avatars.discourse-cdn.com/v4/letter/g/b2d939/32.png) [@gennaroarguzzi](https://community.wolfram.com/u/gennaroarguzzi)\
**Post date:** [May 29, 2016, 7:34am UTC](https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658/3 "2016-05-29T07:34:40Z")

</div>

Thank you very much. At the beginning I tried with wrong statement:

```
WolframAlpha["L*x'+R*x=Abs[sin(t)] and x(0)=0", 
 PodStates -> {"Step-by-step solution"}]

```

Then I tried with the right statement:

```
WolframAlpha["L*x'+R*x=Sqrt[(sin(t))^2] and x(0)=0", 
 PodStates -> {"Step-by-step solution"}]

```

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [May 29, 2016, 8:25am UTC](https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658/4 "2016-05-29T08:25:10Z")

</div>

Also note that Wolfram|Alpha behaves differently from Mathematica. Your post is tagged Wolfram|Alpha but your question suggests Mathematica. From your last post it appears that you call Wolfram|Alpha from within Mathematica. I think that it would be more powerful to use the appropriate Wolfram Language functions such as DSolve and NDSolve.

But then, you ask for step-by-step solutions so that only works with Wolfram|Alpha.

Cheers,

Marco

---

<div class="post-metadata">

**Author:** ![bsimpson141421356](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@bsimpson141421356](https://community.wolfram.com/u/bsimpson141421356)\
**Post date:** [May 29, 2016, 5:35pm UTC](https://community.wolfram.com/t/solve-differential-equation-a-x-b-x-sin-w-t-on-mathematica-calling-w-a/8658/5 "2016-05-29T17:35:22Z")

</div>

Close, but not quite

[WolframAlpha attempt](http://www.wolframalpha.com/input/?i=DSolve%5B%7Ba%20x%27%5Bt%5D%2bb%20x%5Bt%5D==Sqrt%5BSin%5Bt%5D%5E2%5D,x%5B0%5D==0%7D,x%5Bt%5D,t%5D)
