I have MuPAD and Maple and I would like to do the following with one of those softwares:
- I have an equation containing several cosines with different amplitudes and different arguments as depictetd in the picture below in the first (blue) row.
- I want to extract only those cosines which contain at least the argument "+at-bt" (so "+at-bt+alpha" is OK, too) - see second (blue row).
- I want to display the summ of amplitudes of this specific cosines - see third (red) row.
The second picture shows a real example.
Let's say that your long expression is named
expr
. Then do thisNow
subex
is your desired subexpression. If you want to add up the coefficients, then simply doeval(subex, cos= 1)
.Note that this will not find partially factored arguments like
(a-b)*t+alpha
. If you need to find these, let me know.