Jump to content
REX

Homework Help

Recommended Posts

So I need help fixing this output because it's clearly not right, or what was intended rather.

The Object: http://puu.sh/p2WoE/14b1caed6f.txt

The Main: http://puu.sh/p2Wv5/1b469f151a.txt

 

The Output: a2e6170cf8d1e727e040b87c8b74203d.png

 

----- Solution Below by @Sharpienero -----

 

Quote

 

I haven't looked thoroughly through the code but I'm fairly certain that if were were to change "new kid" to something else, all of them would print that out.

Edit: Was bored. Threw these files into an online editor. My hypothesis was correct: baa1Puq.png

Basically what I'm saying is that no matter what the last "scores" you put into the object are, those are the ones that print. I'm assuming your order of precedence is slightly out of wack (meaning when things should print, when they shouldn't)

 

 

Share this post


Link to post

https://gyazo.com/33e77be59d33117f90991dc658d18f9a

Trigonometric Functions, help pls. Need to simplify.

 

----- Solution Below by @Nick-----

 

Quote

I'm pretty sure the simplest form of that would be either (2sinx)/cosx or 2sin(x)sec(x) depending on how your teacher wants it. It's just a matter of having the trig identities memorized and knowing when to apply them. Be careful when using online calculators to help with trig. Even though they will give you the right answer, the steps that they choose are often way harder and more confusing than actually needed for the problem. Edit: (2sinx)/cosx or 2sin(x)sec(x) also simplifies to just 2tanx

 

Share this post


Link to post

a159c42657a35e98c93a5eed7586ff17.pngAlright so I have this fkn problem that i cant do. I wish to get help with like 4, 5, 6 because like I was missing the days the lessons happened and I also looked at the lessons online but couldnt make sense about it. 

 

----- Solution Below by @Nick -----

 

Quote

 

Excuse my handwriting 20160909_013119.jpg

 

 

 

 

Share this post


Link to post

Is it possible to do ∫ k(x)/p(x)  dx (where p and k are non-constant polynomials and p is a higher degree than k) without partial fractions?

for example, if I were trying to do ∫ X/(x^3+1)dx could I say 

y'=x/(x^3+1)

and solve the ode y'(x^3+1)-x=0?

if so how would u go about doing this?

@REX @Space @emerpuss

if the way I worded this is confusing I can try to explain better tomorrow

edit*

prople will ask why do this when u can do partial fraction decomp. My response is that I would rather kill myself than do partial fractions 

Share this post


Link to post
1 hour ago, HawkSlayerr said:

Is it possible to do ∫ k(x)/p(x)  dx (where p and k are non-constant polynomials and p is a higher degree than k) without partial fractions?

for example, if I were trying to do ∫ X/(x^3+1)dx could I say 

y'=x/(x^3+1)

and solve the ode y'(x^3+1)-x=0?

if so how would u go about doing this?

@REX @Space @emerpuss

if the way I worded this is confusing I can try to explain better tomorrow

edit*

prople will ask why do this when u can do partial fraction decomp. My response is that I would rather kill myself than do partial fractions 

Look up Integration Quotient Rule

Share this post


Link to post
6 hours ago, REX said:

Look up Integration Quotient Rule

Looks like a nice idea. But the first pdf I opened when I looked it up had bad math so... Idk if it's trustworthy. I'll check others later

Share this post


Link to post
37 minutes ago, HawkSlayerr said:

Lim((1-x^2/2-cos(x/(1-x^2)))/x^4) as x->0

I'm assuming you're looking for a step-by-step so that you're not dividing by 0? Cause if not the answer is 23/24

This has got me stumped, don't really have anymore time to try it out either, sorry :(

Share this post


Link to post

Well we do have Algebra over here, I started getting it this year. Pretty sure you didn't get it because you did Mavo

Share this post


Link to post
2 minutes ago, sxk said:

Well we do have Algebra over here, I started getting it this year. Pretty sure you didn't get it because you did Mavo

You mean VMBO and now I do MBO-4

So I guess you are doing HAVO or VWO now.

Share this post


Link to post
Just now, BosnianArmy said:

You mean VMBO and now I do MBO-4

So I guess you are doing HAVO or VWO now.

Well we call it Mavo over here, some people call it VMBO-T

I'm doing Havo

Share this post


Link to post
Just now, sxk said:

Well we call it Mavo over here, some people call it VMBO-T

I'm doing Havo

That's why :P

But I think it's quite easy once it's learned like any other math.

Share this post


Link to post

@REX took a solid 3 hours but I figured it out.

i don't have time to post a full solution rn, but pretty much u have to rewrite cos(x) as a McClarin series expansion or whatever. The terms of degree >4 go away and the rest simplifies nicely.

or u could apply lhopitals rule 4 times.. but that's some hairy math

Share this post


Link to post
4 hours ago, HawkSlayerr said:

@REX took a solid 3 hours but I figured it out.

i don't have time to post a full solution rn, but pretty much u have to rewrite cos(x) as a McClarin series expansion or whatever. The terms of degree >4 go away and the rest simplifies nicely.

or u could apply lhopitals rule 4 times.. but that's some hairy math

that's dumb as fuck :neutral:

Share this post


Link to post

For my comp sci ia I'm making a derivative calculator. In it, the user can enter their own function and a point and the calculator takes the derivative at that point. Currently it works, but the thing is if u input "sin(x)" the computer won't know how to deal with it, instead u gotta type "Math.sin(x)". I'm wondering if there's a way so that u can just type "sin(x)" and the compute will recognize it as the sin function.

@Sharpienero @REX@Black Jesus

Share this post


Link to post
1 minute ago, HawkSlayerr said:

For my comp sci ia I'm making a derivative calculator. In it, the user can enter their own function and a point and the calculator takes the derivative at that point. Currently it works, but the thing is if u input "sin(x)" the computer won't know how to deal with it, instead u gotta type "Math.sin(x)". I'm wondering if there's a way so that u can just type "sin(x)" and the compute will recognize it as the sin function.

@Sharpienero @REX@Black Jesus

Use an if to see if what the user enters equals trig function a, b or c.

If it does, use trig func that matches

Share this post


Link to post
3 minutes ago, Black Jesus said:

Use an if to see if what the user enters equals trig function a, b or c.

If it does, use trig func that matches

Yea I've thought of smothering like that. It's a bit trickier tho cuz what if the user enters "sin(x+1)"? 

Share this post


Link to post

use a substring from (0,2) for the trig function, and then from (3,string.length()) for the transformations

Share this post


Link to post
3 hours ago, HawkSlayerr said:

Ok, but what if the user enters a combination of different functions? Then it becomes harder to do that (sin(3x)+cos(4x))

Tokenize the string, act on the functions independently, then combine. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×