Ask Your Question
0

Beginner: Plot sin 2x or 4cos 2x

asked 2015-07-10 14:08:32 +0100

mellow_yellow gravatar image

updated 2024-07-09 08:26:10 +0100

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!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2015-07-10 17:56:02 +0100

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 21:13:17 +0100 )edit
1

answered 2015-07-10 17:51:29 +0100

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 21:14:28 +0100 )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 14:08:32 +0100

Seen: 736 times

Last updated: Jul 10 '15