Message Boards Message Boards

1
|
3873 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Define function without Sec[x] , I want 1/Sin[2x]

Posted 10 years ago

f[x_] := (E^(3 x + 2))/Sin[2*x] gives

E^(2 + 3 x) Csc[2 x]

I dont want that

POSTED BY: peter B
2 Replies

Hi, I would define it as follows.

f[x_] := (E^(3 x + 2))HoldForm[(1/Sin[2*x])]

If you type in f[x] , it returns e^(3x+2) (1/Sin[2x])

In order to evaluate it at any time,

ReleaseHold[ f[x]] /. x -> Pi/4
POSTED BY: Isaac Abraham

How about using Format

     Format[f[x_]] := (E^(3 x + 2))/Sin[2*x] /. Csc[z__] :> HoldForm[ 1/Sin[z]]
     r = f[4 x]

enter image description here

Then

     r /. x -> Pi/3
    (*  (2*E^(2 + 4*Pi))/Sqrt[3]  *)

    r = f[1]
    (* E^5 1/Sin[2] *)

    N[%]
    (* 163.217 *)
POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract