It always happens you want to differentiate with ruby. right?
Dydx will eliminate this. Like this
( d/dx(e ^ :x) ).to_s
=> "( e ^ x )"
$y = cos(:x)
(dy/dx).to_s
=> "( - sin( x ) )"
# pretermit '.to_s'
d/dx(log(:x))
=> "( 1 / x )"
d/dx(:x^:n)
=> "( n * ( x ^ ( n - 1 ) ) )"
d/dx(:x^2)
=> "( 2 * x )"
(That's wonderful!!!!! But, I feel there is no meaning ... )
Add this line to your application's Gemfile:
gem 'dydx'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dydx
include Dydx
- Fork it ( https://github.com/[my-github-username]/dydx/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request