Message Boards Message Boards

0
|
5369 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How would I type the questions into Mathematica.

Posted 10 years ago

This is a homework question I have in calculus, and whatever way I input the question I get a answer of zero and a blank graph so I was wondering what would be the correct way of typing it into Wolfram Mathematica? "1. For the function f(x) = 2 sin x + cos 3x,

     a.      find f(Pi/3)

     b.     find f'(Pi/3) 

     c.     find f''(-Pi/6) 

     d.     graph BOTH f(x) and f'(x) together on the interval (0, 2Pi])"
POSTED BY: Justin Ivers
4 Replies

Hi,

you might try this:

f[x_] := 2 Sin[x] + Cos[3 x]

then

f[Pi/3] 

f'[Pi/3] 

f''[-Pi/6]

For the plot

Plot[{f[x], f'[x]}, {x, 0, 2 Pi}]

will do the trick. You might want to watch online screencasts such as

http://www.wolfram.com/broadcast/screencasts/handsonstart/

Best wishes,

Marco

POSTED BY: Marco Thiel
Posted 10 years ago

First define the function f. The Basic Math Assistant palette has a button to "Define function" (open the palette from the Palettes menu and click on the Advanced tab of the palette in the Calculator section) that inserts a template for defining functions in Mathematica. As you fill in the template remember that all Mathematica commands start with a capital letter, and square brackets are used to surround inputs to functions. Evaluate the cell by clicking on the Enter button on the palette, pressing Shift+Return, or the Return key on a number pad (there is a tooltip for the Enter button on palette that reminds you of the keyboard shortcuts).The correct form to define f is
f[x_] := 2Sin[x] + Cos[3x]

Once f is defined you can evaluate f, f', or f'' for any input. To graph both f and f', use Plot[{function1,function2},{var,min,max}]. A template for this can be inserted into the notebook using the Basic Math Assistant palette by opening the Basic Commands area of the palette, clicking the 2D tab, selecting the first item in the More drop down list under Visualizing Functions, and filling in the template: Plot[{f[x],f'[x]},{x,0,2Pi}] The greek letter for Pi can be entered using the Basic Math palette, or pressing the three keys Escape p Escape (see the tooltip for the pi button on the palette).

POSTED BY: Eric Schulz
Posted 10 years ago

Thanks for your responses I will try them now and get back with you all on if it worked.

POSTED BY: Justin Ivers
Posted 10 years ago

Thanks everyone my only question is why do I have to put brackets around the 3x and x?

POSTED BY: Justin Ivers
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