TransWikia.com

How do I separate the two solutions?

Mathematica Asked on June 25, 2021

Consider the differential equation
$$f”[x]==a f[x]$$
The result is a combination of trigonometric or hyperbolic functions, something like:

f=Function[{x},C[1]Cos[Sqrt[a]x]+C[2]Sin[Sqrt[a]x]

how do I separate the two functions Cos and Sin?

2 Answers

Try

C[1] Cos[Sqrt[a] x] + C[2] Sin[Sqrt[a] x] /. Plus -> List
(*{C[1] Cos[Sqrt[a] x], C[2] Sin[Sqrt[a] x]}*)

Correct answer by Ulrich Neumann on June 25, 2021

sol = DSolve[f''[x] == a f[x], f, x]
f[x] /. First@sol /. C[1] -> 0
f[x] /. First@sol /. C[2] -> 0

Answered by cvgmt on June 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP