Ask Your Question
0

Beginner: Plot sin 2x or 4cos 2x

asked 9 years ago

mellow_yellow gravatar image

updated 0 years ago

FrédéricC gravatar image

Disclaimer: I'm a beginner with Sage.

I'm working with transformations and translations of trig functions, and although I can "plot(sin, (-2,2))" without trouble, how do I plot the following?

sin 2x

or

4cos 2x

or

3sin (x+5) -3

Thanks!

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 9 years ago

ndomes gravatar image

1) have a look at the documentation, for example:

http://doc.sagemath.org/html/en/prep/...

or my plotting tutorial (in German) http://85.214.246.147:8080/home/pub/8/

2)

plot(sin(2*x),-pi,pi)
Preview: (hide)
link

Comments

excellent! thank you!

mellow_yellow gravatar imagemellow_yellow ( 9 years ago )
1

answered 9 years ago

fidbc gravatar image

Hope you are enjoying Sage so far.

A good place to check for things is the sage documentation.

For example, here are some examples which might be relevant for you. The following modification might give you a hint about how to proceed.

h(x) = sin(4*x)
plot(h,(-2*pi,2*pi),color='orange')

Output: image description

Here is another reference which might be useful.

Preview: (hide)
link

Comments

Perfect! Thank you for the detail. I was trying sin(2x) not sin(2*x) and getting an error.

mellow_yellow gravatar imagemellow_yellow ( 9 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 769 times

Last updated: Jul 10 '15