0
$\begingroup$

I have this code of Mathematica

(1/(2 (fj - fk) π))
 Cos[(fj - fk) π T + (fj - fk) π (T + δt)] Sin[(fj - 
       fk) π T - (fj - fk) π (T + δt)]

enter image description here

There are a few terms inside these Sin functions that if multiplied can be canceled out, Can someone tell me how to simplify this expression in Mathematica? TrigReduce, simply, Fullsimply didn't work here.

$\endgroup$
4
  • $\begingroup$ I encounter many equations like this that I need to solve $\endgroup$ Commented Oct 15, 2020 at 12:40
  • $\begingroup$ Are you aware of functions like TrigReduce, TrigExpand, TrigToExp, and ExpToTrig? $\endgroup$
    – TimRias
    Commented Oct 15, 2020 at 12:46
  • $\begingroup$ Yes but my application is different, I want this exact equation for representation purpose so I want Mathematica to simply what is inside this cos and sin for me. The above function changes everything by giving it another shape.@mmeent $\endgroup$ Commented Oct 15, 2020 at 12:49
  • 1
    $\begingroup$ tried Simplify? $\endgroup$
    – kglr
    Commented Oct 15, 2020 at 12:53

1 Answer 1

4
$\begingroup$

Does this do what you want?

expr=(1/(2 (fj - fk) π)) Cos[(fj - fk) π T + (fj - 
   fk) π (T + δt)] Sin[(fj - fk) π T - (fj - 
   fk) π (T + δt)];
expr /. (f : Cos | Sin)[a_] :>  f[Simplify[a]]

This applies Simplify only to the arguments of Sin and Cos

Alternatively,

Simplify[expr,Trig->False]

(This prevents Mathematica from applying Trig manipulations during Simplify

$\endgroup$
3
  • $\begingroup$ I have expertise in wireless communication and I only know MATLAB, has no idea how you did this? Can you do the same for cos term, like both sin and cos? $\endgroup$ Commented Oct 15, 2020 at 12:57
  • $\begingroup$ Why not simplify the whole expression using SImplify["your expression"] $\endgroup$ Commented Oct 15, 2020 at 15:00
  • $\begingroup$ @DanielHuber Because the OP has indicated that they want to keep the overall functional form of the expression. (By default, Simplify will re-express the given expression as a sum of two trig functions rather than the product as given.) $\endgroup$
    – TimRias
    Commented Oct 15, 2020 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.