Skip to content

Commit e98b633

Browse files
committed
Add answer for mathjs
1 parent 17f1f0d commit e98b633

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/3-web-servers/03-module/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,5 +234,15 @@ console.log(format(new Date(), "yyyy年MM月dd日"));
234234

235235
1. サンプルコードの dateFns 変数の中身をデバッガで観察してみましょう。
236236
2. [`mathjs` パッケージ](https://www.npmjs.com/package/mathjs)は、JavaScript で複雑な計算を行うためのライブラリです。このライブラリを用いて、$\log(x)$ を $x$ について微分した式を求めてください。
237+
<Answer>
237238

238-
<ViewSource url={import.meta.url} path="_samples/math-js" noCodeSandbox />
239+
[`mathjs.derivative` 関数](https://mathjs.org/docs/reference/functions/derivative.html)を用いると、微分した式を求めることができます。
240+
241+
```javascript
242+
import { derivative } from "mathjs";
243+
console.log(derivative("log(x, e)", "x").toString());
244+
```
245+
246+
<ViewSource url={import.meta.url} path="_samples/math-js" noCodeSandbox />
247+
248+
</Answer>

0 commit comments

Comments
 (0)