Ask Your Question
0

Beginner: Plot sin 2x or 4cos 2x

asked 2015-07-10 07:08:32 -0500

mellow_yellow gravatar image

updated 2015-07-10 07:18:41 -0500

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!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-07-10 10:56:02 -0500

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)
edit flag offensive delete link more

Comments

excellent! thank you!

mellow_yellow gravatar imagemellow_yellow ( 2015-07-10 14:13:17 -0500 )edit
1

answered 2015-07-10 10:51:29 -0500

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.

edit flag offensive delete link more

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 ( 2015-07-10 14:14:28 -0500 )edit

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: 2015-07-10 07:08:32 -0500

Seen: 363 times

Last updated: Jul 10 '15